Getopt::Attribute

Getopt::Attribute is a Perl module to attribute wrapper for Getopt::Long.
Download

Getopt::Attribute Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Marcel Grnauer
  • Publisher web site:
  • http://search.cpan.org/~marcel/Module-Install-Template-0.05/lib/Module/Install/Template.pm

Getopt::Attribute Tags


Getopt::Attribute Description

Getopt::Attribute is a Perl module to attribute wrapper for Getopt::Long. Getopt::Attribute is a Perl module to attribute wrapper for Getopt::Long.SYNOPSIS use Getopt::Attribute; our $verbose : Getopt(verbose!); our $all : Getopt(all); our $size : Getopt(size=s); our $more : Getopt(more+); our @library : Getopt(library=s); our fines : Getopt(define=s); sub quiet : Getopt(quiet) { our $quiet_msg = 'seen quiet' } usage() if our $man : Getopt(man); ... # Meanwhile, on some command line: mypgm.pl --noverbose --all --size=23 --more --more --more --quiet --library lib/stdlib --library lib/extlib --define os=linux --define vendor=redhat --man -- fooNote: This version of the module works works with perl 5.8.0. If you need it to work with perl 5.6.x, please use an earlier version from CPAN.This module provides an attribute wrapper around Getopt::Long. Instead of declaring the options in a hash with references to the variables and subroutines affected by the options, you can use the Getopt attribute on the variables and subroutines directly.As you can see from the Synopsis, the attribute takes an argument of the same format as you would give as the hash key for Getopt::Long. See the Getopt::Long manpage for details.Note that since attributes are processed during CHECK, but assignments on newly declared variables are processed during run-time, you can't set defaults on those variables beforehand, like this: our $verbose : Getopt(verbose!) = 1; # DOES NOT WORKInstead, you have to establish defaults afterwards, like so: our $verbose : Getopt(verbose!); $verbose ||= 1;Alternatively, you can specify a default value within the Getopt attribute: our $def2 : Getopt(def2=i 42);Requirements:· Perl Requirements: · Perl


Getopt::Attribute Related Software