use 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