in reply to file input from command line
A more general-purpose answer: see Getopt::Long or other options modules.