in reply to No arguments or filenames

try:
usage() unless @ARGV; ... sub usage() { #print out program usage info, flags, etc #then exit() }

This will print the usage info and exit if there are no command line parameters (which are stored in @ARGV)