Back-slashes & calling a batch file from perl ???
by Michael D Schleif other posts by this author
Oct 27 2005 1:15PM messages near this date
view in the new Beta List Site
RE: cd the cmd shell from perl (as can be done from bat file)
|
Re: Back-slashes & calling a batch file from perl ???
I have a perl script that calls a batch file (necessary), and passes it
two arguments. The first argument is a directory name, and the second a
simple label.
When I used forward-slashes (/) everywhere, the perl script behaves as
expected; but, the batch file refuses to recognize the legitimacy of the
directory name; at least in the context of passing it to the batch file
in a system() call, as I need to parse the exit codes.
my $dir = "E:/backup";
Yes, I test `-d $dir' successfully. The batch file refuses to accept
$dir while using forward-slashes. I am using s/// to replace (/) with
any number of (\). I have tried up to eight (8) back-slashes; but,
everytime the script mis-behaves, and I have not been able to complete
this simple task.
What am I missing?
What do you think?
--
Best Regards,
mds
mds resource
877.596.8237
-
Dare to fix things before they break . . .
-
Our capacity for understanding is inversely proportional to how much
we think we know. The more I know, the more I know I don't know . . .
--
Attachments:
signature.asc
unknown1
unknown2
unknown3
Thread:
Michael D Schleif
Michael D Schleif
Chris Wagner
$Bill Luebkert
$Bill Luebkert
Michael D Schleif
$Bill Luebkert
Michael D Schleif
$Bill Luebkert
Michael D Schleif
$Bill Luebkert
James Sluka
Ted Zeng
$Bill Luebkert
Ted Zeng
Paul
Peter Eisengrein
Trevor Joerges
Jim Guion
$Bill Luebkert
James Sluka
$Bill Luebkert
Chris Wagner
|