Awk-dogg has asked for the wisdom of the Perl Monks concerning the following question:
A script master.pl can look in one 26 files (A-Z) to open a file handle from. How do I specify this on a command line so that it will open the correct file.
For example, if I wanted it to open a file in the A directory, I could hard-code master: open(FILEHANDLE, "/data/A/file"); If I'm always going to run the same filename, how could I get it to run based on a command line argument A-Z?
Ultimately I want it to run:
and so on..../master.pl A # looks for file under /data/A ./master.pl B # looks for file under /data/B
Thanks for the help
Edit: chipmunk 2001-07-15
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: The file I want to open must be determined by a command line argument
by HyperZonk (Friar) on Jul 14, 2001 at 07:50 UTC | |
by tilly (Archbishop) on Jul 15, 2001 at 02:04 UTC | |
|
Re: The file I want to open must be determined by a command line argument
by Thathom (Acolyte) on Jul 15, 2001 at 01:02 UTC |