Getopt...::Group(3pm)

πŸ“¦ version 2.000011, in ubuntu stonking

πŸ’– 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 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