|Do you know where your variables are?|
Command-line arguments to command-line Perlby RecursionBane (Beadle)
|on Oct 03, 2010 at 20:04 UTC||Need Help??|
RecursionBane has asked for the
wisdom of the Perl Monks concerning the following question:
Long have I assimilated knowledge from you, unseen. I emerge from the shadows of Lurkwood to place this query before you:
How do I provide command-line arguments to a command-line Perl call (from a tcsh script, no less)?
The purpose of this operation is to replace this line in ConfigFile:
(Where $tcsh_input is actually a command-line argument to the tcsh script)
Here is what I am attempting now in my tcsh script:
perl -pi -e '$design = $ARGV ; s/.*'def'.*''/\t"def" => "dumper\/$design.def",/g' ConfigFile $tcsh_input
Any arguments after the -e switch, however, seem to be treated as input files, so I see this:
Is there a separate switch I can use before -e to represent the arguments (accessible through @ARGV) to the program?
Kindly bless me with your wisdom, so that I may express my gratitude and scurry back into the shadows from whence I came; all this light is hurting my eyes.