in reply to No arguments or filenames

The command line arguments for your script live in the array @ARGV:

#!/usr/bin/perl -w if (!@ARGV) { print STDERR << "SYNTAX"; myprogram [option][filename] -x does something -y does something else SYNTAX exit 1; }

Also, take a look at the Getopt::Std module to handle your switch processing.

-Matt