Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Getopt::Attribute 2.101700

    Download button

    No screenshots available
    Downloads: 321  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Marcel Grünauer | More programs
    Perl Artistic License / FREE
    April 12th, 2007, 07:05 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Getopt::Attribute description

    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 -- foo


    Note: 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 WORK
    Instead, 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);



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    attribute wrapper | Getopt::Long wrapper | Perl module | module | attribute | Getopt::Long

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM