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

    Getopt::GetArgs 1.03

    Download button

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

    License / Price:

    Last Updated:

    Category:
    Rob Brown | More programs
    Perl Artistic License / FREE
    April 11th, 2007, 23:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Getopt::GetArgs description

    GetArgs is a Perl module to allow enhanced argument passing.

    GetArgs is a Perl module to allow enhanced argument passing, including passing of case-insensitive named arguments as well as positioned arguments.

    SYNOPSIS

    sub WHATEVER {
    my @DEFAULT_ARGS =
    ( Content => "Default content",
    Verbose => 0
    );
    my %ARGS=GetArgs(@_,@DEFAULT_ARGS);
    # do some stuff with $ARGS{Content}
    # show all kinds of detail if $ARGS{Verbose}
    }

    # a simple call to WHATEVER
    WHATEVER( "Just deal with my content" );

    # a flexible call to WHATEVER
    WHATEVER({ verbose => 1,
    content => "This is my content",
    });

    GetArgs needs to know * what your subroutine was passed, * and what it expected to be passed. * If you like, you can also supply default values to use when an argument is not passed.

    Using this information, GetArgs will create a hash of arguments for you to use throughout your subroutine. Using GetArgs has several advantages:

    1) Calls to your subroutine can pass named arguments, making the code more readable.
    2) If it's easier to pass a list of arguments as you normally would, that's fine.
    3) With GetArgs your use of arguments in your subroutine code is more readable.
    4) Your subroutines are no longer limited in the number of arguments they expect.
    5) Arguments can be passed in any order (if passed inside the hash ref), thus only the arguments relevant to that call need to be passed--unnecessary arguments can be ignored.
    6) Case is not important, as GetArgs matches argument names case insensitively.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    argument passing | named arguments | Perl module | Getopt::GetArgs | argument | passing

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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