in reply to Problem in passing multiple argument through command line
But you should be careful that you pass only name and location, not anything else otherwise those junk would show up as names An sample command line would look likeuse strict; use warnings; use Getopt::Long; my $location; my $name; if(!GetOptions( "name", "location=s"=> \$location ) ) { print "\nUnknown options have been provided\n"; } $name=join(" ",@ARGV); print "Name is $name and location is $location";
perl 650479.pl -name Ram Sam Dam Yam -location Germany
|
|---|