GetOptions( "u|updated:s" => \my $update, "x|XMLFile:s" => \my $xmllocation, "e|XLSFile:s" => \my $xlsfile, ); $update or die "..."; $xmllocation or print "blabla"; $xlslocation or print "blablabla"; #And in your routine system(qq(sjdks $xmlfile)) if $xmlfile; #dito for $xlsfile