use warnings; use strict; use Getopt::Long; my %opts; GetOptions(\%opts, qw( p=s o=s i=s h=s )) or die; if ($opts{i}) { print "i\n"; } elsif ($opts{h}) { print "h\n"; }
Here is one invocation:
$ script.pl -p prod -i foo -h bar i
In reply to Re: The command line arguments
by toolic
in thread The command line arguments
by abcdefg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |