#!/usr/bin/perl use warnings; use strict; my $usage = "Usage: script -u username -x xval(optional) -m mval(optio +nal)\n"; my $username=undef; my $xvalue=undef; my $mvalue=undef; while(@ARGV){ my $argin = shift; if ($argin =~ /-u/){$username= shift} if ($argin =~ /-x/){$xvalue=shift} if ($argin =~ /-m/){$mvalue =shift} } if ( !defined $username ){print $usage;exit;} print "username = $username\n -x = $xvalue\n -m = $mvalue\n";
In reply to Re: option on command line
by zentara
in thread option on command line
by Sara
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |