roberree has asked for the wisdom of the Perl Monks concerning the following question:
I know absolutely nothing about Perl (I don't know much about computers in general). However, I was just handed a .pl file and told I could modify it to make it work for me. I'm sure this answer is easy, but I'm not even sure of the right lingo to find the answer. The file starts with:
print "Enter base name of input files\n"; chomp ($basename = <STDIN>);
I understand that this just prompts me for a variable name. If I replace <STDIN> with 'filename', it uses the file appropriately. My question is, can I start this .pl file and pass this variable at the same time without having to go in and edit the .pl file each time? I'd expect something like:
./file.pl $basename='filename'It would be even easier if I could just execute this with:
./file.pl filenameI'm trying to submit a bunch of files to be run batch on a parallel cluster, and I'm sick of having to go in and change every file name in the .pl file. Any words of wisdom? Again, take it easy on me. I've searched around and can't find the exact answer.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: adding a variable definition to execution
by Your Mother (Archbishop) on May 21, 2009 at 22:25 UTC | |
|
Re: adding a variable definition to execution
by akho (Hermit) on May 21, 2009 at 22:17 UTC | |
|
Re: adding a variable definition to execution
by Perlbotics (Archbishop) on May 21, 2009 at 22:25 UTC | |
|
Re: adding a variable definition to execution
by lostjimmy (Chaplain) on May 21, 2009 at 22:29 UTC | |
by akho (Hermit) on May 21, 2009 at 23:49 UTC | |
|
Re: adding a variable definition to execution
by bichonfrise74 (Vicar) on May 21, 2009 at 22:41 UTC | |
|
Re: adding a variable definition to execution
by Your Mother (Archbishop) on May 22, 2009 at 04:59 UTC |