have a look at the use Getopt::Long; module, it
handles this pretty nicely.
example:
use Getopt::Long;
&GetOptions("source=s" => \$sourcedir,"help"
=> \$help);
if($help){
print "commandline parameters:\n"; print " -help : this help\n"; print " -source <dir> : source dir\n"; exit;
} then you casn call your script with: scriptname.pl
-source /some/path
|
- [Perl-unix-users] Command line argumen... THOMAS,ANN \(Non-HP-Singapore,ex1\)
- Re: [Perl-unix-users] Command lin... Merijn van den Kroonenberg
- Re: [Perl-unix-users] Command lin... Colin Foran