Getopt:...:Parser(3pm)
π Getopt::Long::Parser π
okay so welcome to the Getopt:...:Parser(3pm) page from the Perl Programmers Reference Guide, bestie β we're covering the object-oriented interface to Getopt::Long, and it's giving useful β¨
π NAME π
Getopt::Long::Parser β the object-oriented interface to Getopt::Long, fr fr π
β¨ SYNOPSIS β¨
use Getopt::Long::Parser;
my $p = Getopt::Long::Parser->new;
$p->configure( %options );
if ( $p->getoptions( @options ) ) { ... }
if ( $p->getoptionsfromarray( \@array, @options ) ) { ... }
Configuration options can be passed to the constructor:
my $p = Getopt::Long::Parser->new( config => [ %options ] );
πΈ DESCRIPTION πΈ
Getopt::Long::Parser is an object-oriented interface to Getopt::Long. See its documentation for configuration and use. π
ngl, note thatGetopt::LongandGetopt::Long::Parserare not object-oriented.Getopt::Long::Parseremulates an object-oriented interface, which should be okay for most purposes. π
π CONSTRUCTOR π
my $p = Getopt::Long::Parser->new( %options );
The constructor takes an optional hash with parameters. π«Ά
config π
configβ an array reference with configuration settings. See "Configuring Getopt::Long" inGetopt::Longfor all possible settings.
π¦ METHODS π¦
In the examples, $p is assumed to be the result of a call to the constructor. π
configure
$p->configure( %settings );
Update the current config settings. See "Configuring Getopt::Long" in Getopt::Long for all possible settings. β¨
getoptionsfromarray
my $res = $p->getoptionsfromarray( $aref, @opts );
getoptions
my $res = $p->getoptions( @opts );
The same as getoptionsfromarray( \@ARGV, @opts ). π
π SEE ALSO π
Getopt::Long
π AUTHOR π
Johan Vromans <jvromans@squirrel.nl> π
π COPYRIGHT AND DISCLAIMER π
This program is Copyright 1990,2015,2023 by Johan Vromans. This program is free software; you can redistribute it and/or modify it under the same terms as Perl. π
π final sign-off bestie: this page comes from perl v5.42.3, dated 2026-11-03 β periodt, slay, bye! π
β¨
π¦ where this page comes from
- alpine 3.24: perl-doc 5.42.3-r0 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms