#!/use/your/bin/perl -w use strict; unless (@ARGV) {&usage} use Getopt::Long; my %options; my $ret = GetOptions( "i" => \$options{i}, "o=s" => \$options{o}, "p=s" => \$options{p}, "h" => \$options{h} ); if ($ret eq "" || $options{'h'}) {&usage} if ($options{i}) { print "i is enabled\n"; } if ($options{o}) { print "o is enabled file is $options{o}\n"; } if ($options{p}) { print "p is enabled value is $options{p}\n"; } sub usage { print " \nCommand line options: -i interactive -o file give a file -h help -p value personal\n"; exit; }