I tried use the below but it fails when the tool is run as below finddata.exe -b file.txt data.txt (note the missing -l before data.txt). if ($#ARGV < 1) { print "USAGE"; }