README
1NAME
2 Getopt::Attribute - Attribute wrapper for Getopt::Long
3
4VERSION
5 version 2.101700
6
7SYNOPSIS
8 use Getopt::Attribute;
9
10 our $verbose : Getopt(verbose!);
11 our $all : Getopt(all);
12 our $size : Getopt(size=s);
13 our $more : Getopt(more+);
14 our @library : Getopt(library=s);
15 our %defines : Getopt(define=s);
16 sub quiet : Getopt(quiet) { our $quiet_msg = 'seen quiet' }
17 usage() if our $man : Getopt(man);
18
19 # Meanwhile, on some command line:
20 #
21 # mypgm.pl --noverbose --all --size=23 --more --more --more --quiet
22 # --library lib/stdlib --library lib/extlib
23 # --define os=linux --define vendor=redhat --man -- foo
24
25DESCRIPTION
26 Note: This version of the module works works with perl 5.8.0. If you
27 need it to work with perl 5.6.x, please use an earlier version from
28 CPAN.
29
30 This module provides an attribute wrapper around "Getopt::Long". Instead
31 of declaring the options in a hash with references to the variables and
32 subroutines affected by the options, you can use the "Getopt" attribute
33 on the variables and subroutines directly.
34
35 As you can see from the Synopsis, the attribute takes an argument of the
36 same format as you would give as the hash key for "Getopt::Long". See
37 the "Getopt::Long" manpage for details.
38
39 Note that since attributes are processed during CHECK, but assignments
40 on newly declared variables are processed during run-time, you can't set
41 defaults on those variables beforehand, like this:
42
43 our $verbose : Getopt(verbose!) = 1; # DOES NOT WORK
44
45 Instead, you have to establish defaults afterwards, like so:
46
47 our $verbose : Getopt(verbose!);
48 $verbose ||= 1;
49
50 Alternatively, you can specify a default value within the "Getopt"
51 attribute:
52
53 our $def2 : Getopt(def2=i 42);
54
55 To check whether there was an error during "getopt" processing you can
56 use the "error()" function:
57
58 pod2usage(-verbose => 2, -exitval => 0) if Getopt::Attribute->error;
59
60METHODS
61 error
62 FIXME
63
64 options
65 FIXME
66
67INSTALLATION
68 See perlmodinstall for information and options on installing Perl
69 modules.
70
71BUGS AND LIMITATIONS
72 No bugs have been reported.
73
74 Please report any bugs or feature requests through the web interface at
75 <http://rt.cpan.org>.
76
77AVAILABILITY
78 The latest version of this module is available from the Comprehensive
79 Perl Archive Network (CPAN). Visit <http://www.perl.com/CPAN/> to find a
80 CPAN site near you, or see
81 <http://search.cpan.org/dist/Getopt-Attribute/>.
82
83 The development version lives at
84 <http://github.com/hanekomu/Getopt-Attribute/>. Instead of sending
85 patches, please fork this project using the standard git and github
86 infrastructure.
87
88AUTHOR
89 Marcel Gruenauer <marcel@cpan.org>
90
91COPYRIGHT AND LICENSE
92 This software is copyright (c) 2001 by Marcel Gruenauer.
93
94 This is free software; you can redistribute it and/or modify it under
95 the same terms as the Perl 5 programming language system itself.
96
97