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.
In reply to adding a variable definition to execution by roberree
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |