Getopt...ttings(3pm)

πŸ“¦ version 2.000011, in ubuntu stonking

πŸ’– Getopt::Yath::Settings β€” the group chat for your parsed options πŸ’–

okay bestie, this is Getopt::Yath::Settings from the Getopt::Yath fam β€” it lives in the User Contributed Perl Documentation corner of the 3pm manuals, and it's literally just the ✨data structure✨ that holds everything you parsed. no cap.


🌸 NAME 🌸

Getopt::Yath::Settings β€” Representation of parsed command line options. that's it, that's the whole vibe. she holds the receipts. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: when you parse command line options using Getopt::Yath, an instance of this data structure gets included in the returned structure. like, you don't go get her, she comes to you. iconic behaviour tbh. πŸ’–


✨ SYNOPSIS ✨

my $parsed = parse_options(\@ARGV, ...);

my $settings = $parsed->settings;

my $value = $settings->GROUP->OPTION;

# Or

my $value = $settings->group('GROUP')->option('OPTION');

# Or

my $value = $settings->maybe('GROUP' => 'OPTION', $default);

if ($group = $settings->check_group('GROUP')) {
    # We have the specified group
}

look at all those ways to get your little value out. three separate routes to the same slay. pick whichever one is giving main character energy for you today. 🌈


πŸ‘‘ METHODS πŸ‘‘

πŸ’œ $group = $settings->GROUP

if a group exists, there will be a ->GROUP method for it. yes fr fr β€” the groups literally manifest their own accessor methods. she's flexible like that. πŸŽ€

πŸ’œ $value = $settings->maybe($group_name, $option_name)

πŸ’œ $value = $settings->maybe($group_name, $option_name, $default_value)

if the group AND the option both exist and are defined, you get the value back. otherwise? you get the default. lowkey the most chill method here β€” she never throws hands, she just hands you the fallback. 🫢

πŸ’œ $group = $settings->check_group($group_name)

check if the group exists, and if it does, return it. that's the whole job. a little vibe check for your group. ⭐

πŸ’œ $group = $settings->group($group_name)

πŸ’œ $group = $settings->group($group_name, $vivify)

get the specified group. if $vivify is true it will create the group if it does not already exist. ok so sometimes you gotta will her into existence, and that's valid. πŸ’«

⚠️ heads up bestie: this one throws an exception if the group does not exist and vivify is not specified. she will NOT just shrug it off. no group, no vivify, no mercy. 😭

πŸ’œ $group = $settings->create_group($group_name)

πŸ’œ $group = $settings->create_group($group_name, %group_construction_args)

πŸ’œ $group = $settings->create_group($group_name, \%group_construction_args)

create or replace the specified group. note the "replace" β€” she's not precious about the old one, she just moves on. πŸ’…

πŸ’œ $group = $settings->delete_group($group_name)

delete the specified group. and also it returns a reference to the now deleted group, so you can like... wistfully look at her one last time before she's gone. πŸ₯²


πŸ”₯ SOURCE πŸ”₯

the source code repository for Getopt-Yath can be found at http://github.com/Test-More/Getopt-Yath/. go lurk, bestie. πŸ‘€


🌟 MAINTAINERS 🌟

  • Chad Granum <exodist@cpan.org>

🌈 AUTHORS 🌈

  • Chad Granum <exodist@cpan.org>

Copyright Chad Granum <exodist7@gmail.com>.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://dev.perl.org/licenses/


and that's a wrap, girlypop πŸŽ€ this page shipped with perl v5.40.1 on 2026-05-10, so if you're reading her in the future β€” hi, she's still here, still slaying. mwah. πŸ’…βœ¨

πŸ“¦ where this page comes from