Getopt...::Group(3pm)
π Getopt::Yath::Settings::Group β the whole vibe
okay bestie, so this is Getopt::Yath::Settings::Group, a perl module hanging out in the User Contributed Perl Documentation section, and it's literally the lil container that holds one option group. π
β¨ NAME β¨
Getopt::Yath::Settings::Group β representation of an option group. yes that's the whole job. she holds the group. iconic behavior. π
πΈ DESCRIPTION πΈ
So this thing is used by Getopt::Yath::Settings to represent parsed group settings β like, once your options actually got parsed and sorted into groups, this is the object that carries one of those groups around. it's giving "backstage pass to your parsed settings." π¦
π«Ά SYNOPSIS π«Ά
here's how you'd actually use her, no cap:
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
}
see how there's like three different routes to the same value? pick your fighter. π
π METHODS π
%options = $group->all
gimme everything β all options as key/value pairs. the whole closet, no filter. π§
$bool = $group->check_option($option_name)
does this option even exist? returns a bool, so you can ask without commiting to anything. lowkey polite of her. β¨
$value = $group->option($option_name)
$value = $group->option($option_name, $value)
$group->option($option_name) = $value
get an option, or set an option. that's it, that's the method. both directions, one name. π
$group->create_option($option_name, $value)
make the specified option exist. born. π±
$ref = $group->option_ref($option_name)
$ref = $group->option_ref($option_name, $create)
hand me a reference to the value of the specified option β and optionally create it if it's not there yet (that's the $create bit):
my $ref = $group->option_ref('foo');
$$ref = 'I am setting the option value';
you deref it and set the value directly. sneaky but legal. π
$value = $group->delete_option($option_name)
$value = $group->remove_option($option_name)
delete an option and get back the value it used to have. two names, same girl β pick whichever one vibes harder. π
π₯ SOURCE π₯
the source code repository for Getopt-Yath lives at <http://github.com/Test-More/Getopt-Yath/>. go peek, bestie, it's right there. π
π MAINTAINERS π
Chad Granum <exodist@cpan.org>
π AUTHORS π
Chad Granum <exodist@cpan.org>
π COPYRIGHT π
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 the whole page, periodt. π this was perl v5.40.1, dated 2026-05-10, and the page itself is Getopt...::Group(3pm) from the User Contributed Perl Documentation β mwah, go forth and parse your options. πβ¨π¦
π¦ where this page comes from
- ubuntu stonking: libgetopt-yath-perl 2.000011-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms