1
1
# ! perl
2
2
3
- # Parser.pm -- Getopt::Long object oriented interface
3
+ # Parser.pm -- Getopt::Long object- oriented interface
4
4
# Author : Johan Vromans
5
5
# Created On : Thu Nov 9 10:37:00 2023
6
- # Last Modified On: Sat Nov 11 17:48:49 2023
7
- # Update Count : 13
6
+ # Last Modified On: Tue Jun 11 13: 17:57 2024
7
+ # Update Count : 16
8
8
# Status : Released
9
9
10
+ use strict;
11
+ use warnings;
12
+
10
13
package Getopt::Long::Parser ;
11
14
12
- our $VERSION = 2.57;
15
+ # Must match Getopt::Long::VERSION!
16
+ our $VERSION = 2.58;
13
17
14
18
=head1 NAME
15
19
16
- Getopt::Long::Parser - Getopt::Long object oriented interface
20
+ Getopt::Long::Parser - Getopt::Long object- oriented interface
17
21
18
22
=head1 SYNOPSIS
19
23
20
24
use Getopt::Long::Parser;
21
25
my $p = Getopt::Long::Parser->new;
22
- $p->configure( ...configuration options... );
23
- if ( $p->getoptions( ... options descriptions... ) ) ...
24
- if ( $p->getoptionsfromarray( \@array, ... options descriptions... ) ) ...
26
+ $p->configure( % options );
27
+ if ( $p->getoptions( @ options ) ) { ... }
28
+ if ( $p->getoptionsfromarray( \@array, @ options ) ) { ... }
25
29
26
30
Configuration options can be passed to the constructor:
27
31
28
- my $p = Getopt::Long::Parser->new
29
- config => [...configuration options...];
32
+ my $p = Getopt::Long::Parser->new( config => [ %options ] );
30
33
31
34
=head1 DESCRIPTION
32
35
33
- Getopt::Long::Parser is an object oriented interface to
36
+ C< Getopt::Long::Parser > is an object- oriented interface to
34
37
L<Getopt::Long> . See its documentation for configuration and use.
35
38
36
- Note that Getopt::Long and Getopt::Long::Parser are not object
37
- oriented. Getopt::Long::Parser emulates an object oriented interface,
39
+ Note that C<Getopt::Long > and C<Getopt::Long::Parser > are not
40
+ object-oriented.
41
+ C<Getopt::Long::Parser > emulates an object-oriented interface,
38
42
which should be okay for most purposes.
39
43
40
44
=head1 CONSTRUCTOR
@@ -93,7 +97,7 @@ use warnings 'redefine';
93
97
94
98
=head1 METHODS
95
99
96
- In the examples, $p is assumed to be the result of a call to the constructor.
100
+ In the examples, C< $p > is assumed to be the result of a call to the constructor.
97
101
98
102
=head2 configure
99
103
@@ -116,13 +120,13 @@ sub configure {
116
120
117
121
=head2 getoptionsfromarray
118
122
119
- $res = $p->getoptionsfromarray( $aref, @opts );
123
+ my $res = $p->getoptionsfromarray( $aref, @opts );
120
124
121
125
=head2 getoptions
122
126
123
- $res = $p->getoptions( @opts );
127
+ my $res = $p->getoptions( @opts );
124
128
125
- The same as getoptionsfromarray( \@ARGV, @opts ).
129
+ The same as C< getoptionsfromarray( \@ARGV, @opts ) > .
126
130
127
131
=cut
128
132
0 commit comments