A more general-purpose answer: see Getopt::Long or other options modules.
In reply to Re: file input from command line by John M. Dlugosz in thread file input from command line by Anonymous Monk