use Getopt::Long; sub usage { print "\nUsage: thisProgram -f \n"; exit(1); } GetOptions("f=s=>\$userInput"); &usage() if (!defined($userInput));