Wednesday 24 February 2010

getopts standard in perl

sample getopts usage:


use Getopt::Std;
my $getopts_status = getopts('p:dl:L:tcas');

if (! $getopts_status ||
! (defined($Getopt::Std::opt_p)) ||
! (defined($Getopt::Std::opt_l))) {
die "usage: myscript.pl -p dirname -l logfile [ -L optional logfile ] [-t] [-c] [-a] [-d] [-s]\n";
}



No comments:

Post a Comment

Tweets by @sriramperumalla