dimmesdale has asked for the wisdom of the Perl Monks concerning the following question:
I need to call a perl script test.pl with two arguments. The arguments are variables, and I need them interpolated. The second argument I need to actually combine two variables with a '\' (it's a directory path), and have them, of course, interpolated as well.
Now, I can imagine that
`perl test.pl "$var1" "$var2\\$var3"`
won't work (and is quite atrocious). I tested several variants (making a temporary variable) and none seemed to work (let it be noted that I took the quotes out, and made a test.pl file to print its given arguments; on several tests I got a 'Bad command/filename, etc' error, and several nothing happened at all, save a short pause).
WHAT WILL WORK?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) Re: A question with commands
by jeffa (Bishop) on Jun 24, 2002 at 15:02 UTC | |
by demerphq (Chancellor) on Jun 24, 2002 at 16:46 UTC | |
|
Re: Variable interpolation using back ticks
by talexb (Chancellor) on Jun 24, 2002 at 14:59 UTC | |
by dimmesdale (Friar) on Jun 24, 2002 at 15:09 UTC |