Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have a program where I need to pass a filename (and location) to the program. How can I do this? I have read the GetOpt doc so please don't point me there. My command line is as follows:
perl myprogram.pl -input C:\inputfilelocation -output C:\outputfileloc +ation
My GetOptions look like this:
GetOptions('input=s' => \$input,'output=s' => \$output);
Basically I need to figure out how to access that file in a while loop that I have which iterates over the lines in the file and puts each into $_
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to pass a file to GetOpt
by aaron_baugher (Curate) on Jul 10, 2012 at 22:21 UTC | |
by Anonymous Monk on Jul 10, 2012 at 23:26 UTC | |
by Anonymous Monk on Jul 10, 2012 at 23:46 UTC | |
by Anonymous Monk on Jul 11, 2012 at 00:27 UTC | |
by kcott (Archbishop) on Jul 11, 2012 at 00:57 UTC | |
| |
Re: How to pass a file to GetOpt
by onelesd (Pilgrim) on Jul 10, 2012 at 21:58 UTC | |
by Anonymous Monk on Jul 10, 2012 at 22:01 UTC | |
by onelesd (Pilgrim) on Jul 10, 2012 at 22:09 UTC |
Back to
Seekers of Perl Wisdom