Getopt::Simple

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

Getopt::Simple Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Ron Savage
  • Publisher web site:
  • http://search.cpan.org/~rsavage/

Getopt::Simple Tags


Getopt::Simple Description

Getopt::Simple is 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 ") ) { 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 switchesType information for switch valuesDefault values for the switchesHelp text per switch Requirements: · Perl


Getopt::Simple Related Software