in reply to Re: Command-line arguments to command-line Perl
in thread Command-line arguments to command-line Perl
Thanks for the response, NetWallah!
This is, indeed, Linux. Rather than escape-character woes, I think the problem I'm facing is because everything after the -e <program code> switch is treated as an input file (and not an argument to the Perl program itself).
In my code example, I would like $ARGV[0] to contain a certain value (ADCIF, in this case):
perl -pi -e '$design = $ARGV[0] ; s/.*'def'.*''/\t"def" => "dumper\/$design.def",/g' ConfigFile $tcsh_input
This code should behave like so:
perl -pi -e '$design = "ADCIF" ; s/.*'def'.*''/\t"def" => "dumper\/$design.def",/g' ConfigFile
Here, I am trying to provide "ADCIF" to the perl script on-the-fly (which is why I need the argument to be contained in @ARGV).
I apologize if my initial question was unclear. Please let me know if you have any other suggestions.
~RecursionBane
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Command-line arguments to command-line Perl
by morgon (Priest) on Oct 03, 2010 at 23:04 UTC | |
by RecursionBane (Beadle) on Oct 04, 2010 at 04:58 UTC | |
Re^3: Command-line arguments to command-line Perl
by suhailck (Friar) on Oct 04, 2010 at 01:11 UTC | |
by RecursionBane (Beadle) on Oct 04, 2010 at 04:57 UTC |