I’ve read the doc for GetOptions but I can’t seem to find what I need… (maybe I am blind)
What I want to do is to parse command line like this
myperlscript.pl -mode [sth] [inputfile]
I can use the -mode part, but I am not sure how to get the [inputfile]. Any advice will be appreciated.
You don’t use
GetOptionsfor this task.GetOptionswill simply parse options for you and leave everything that is not an option in@ARGV. So after callingGetOptionssimply look at@ARGVfor any file names passed on the command line.