bahadur has asked for the wisdom of the Perl Monks concerning the following question:
thanks for the replies
this is what i dont get
why do we need to create variables like data and length when the arguments will be passed from command line. here is what i want to do. take -u user name, -p password, -s hostname:portnumber from the command like and then how will they be used with this module? how can this parser help me in parsing the above mentioned command line arguments. p.s: after recieving them from the command like i ll send the user name pasword for validation to the host given on the command like. so like i want to know how using this parser will be more helpful in parsing the command line arguments. and how it will be more difficult with out using the parser?my $data = "file.dat"; my $length = 24; my $verbose; $result = GetOptions ("length=i" => \$length, # numeric "file=s" => \$data, # string "verbose" => \$verbose); # flag
Retitled by Steve_p from 'Getopt::Long'.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Examples for using Getopt::Long
by Joost (Canon) on May 09, 2005 at 13:33 UTC | |
Re: Examples for using Getopt::Long
by mpeters (Chaplain) on May 09, 2005 at 13:44 UTC | |
Re: Examples for using Getopt::Long
by ww (Archbishop) on May 09, 2005 at 14:10 UTC | |
Re: Examples for using Getopt::Long
by thcsoft (Monk) on May 09, 2005 at 13:19 UTC | |
Re: Examples for using Getopt::Long
by ikegami (Patriarch) on May 09, 2005 at 15:29 UTC | |
| |
Re: Examples for using Getopt::Long
by graff (Chancellor) on May 10, 2005 at 04:00 UTC |
Back to
Seekers of Perl Wisdom