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::Simple 1.52

    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:
    Ron Savage | More programs
    Perl Artistic License / FREE
    November 4th, 2006, 04:05 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Getopt::Simple description

    A Perl module that provides a simple wrapper around Getopt::Long.

    Getopt::Simple is a Perl module that provides a simple wrapper around Getopt::Long.

    SYNOPSIS

    use Getopt::Simple;

    # Or ...
    # use Getopt::Simple qw($switch);

    my($options) =
    {
    help =>
    {
    type => '',
    env => '-',
    default => '',
    # verbose => '', # Not needed on every key.
    order => 1,
    },
    username =>
    {
    type => '=s', # As per Getopt::Long.
    env => '$USER', # Help text.
    default => $ENV{'USER'} || 'RonSavage', # In case $USER is undef.
    verbose => 'Specify the username on the remote machine',
    order => 3, # Help text sort order.
    },
    password =>
    {
    type => '=s',
    env => '-',
    default => 'password',
    verbose => 'Specify the password on the remote machine',
    order => 4,
    },
    };

    my($option) = Getopt::Simple -> new();

    if (! $option -> getOptions($options, "Usage: testSimple.pl [options]") )
    {
    exit(-1); # Failure.
    }

    print "username: $$option{'switch'}{'username'}. n";
    print "password: $$option{'switch'}{'password'}. n";

    # Or, after 'use Getopt::Simple qw($switch);' ...
    # print "username: $$switch{'username'}. n";
    # print "password: $$switch{'password'}. n";


    Getopt::Simple is a pure Perl module.

    The Getopt::Simple module provides a simple way of specifying:

    Command line switches

    Type information for switch values

    Default values for the switches

    Help text per switch

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    Getopt::Long wrapper | simple wrapper | Perl module | switch | Getopt::Long. | wrapper

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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