On Wed, Nov 13, 2002 at 04:53:45PM +0000, Nick Ing-Simmons wrote:
> >I think I've found a solution. I just ran this in a Win98 DOS window:
>
> As I recall the quoting rules for Win9X's command.com and winNT's cmd.exe are
> different. I think the real snag is how to get a '"' in the string which is
> why all the Win32 perl -e ... use "" and then qq inside.
>
> The snag with that is if you use -e "" on UNIX $foo is interpollated by
> the shell. (On Win32 there is some risk %foo will be interpollated...)
That's ok, I was just using the variable to see what the string was
evaluating to. I kept forgetting to backwack the backwacks in the filepath.
So there's really no variable to worry about.
perl -e "`\42C:\\Program Files\\Opera\\Opera.exe\42`"
and the find_perl command becomes something like:
$val = `"$abs" -e "require $ver"; print "VER_OK\n"`
so there's no variables in the program that gets passed to the shell.
Unfortunately, this still leaves the sticky problem of trapping STDERR on
Win9X. 2>&1 doesn't work. This does:
$val = `"$abs" -e "close STDERR; require $ver"; print "VER_OK\n"`
but that assumes $abs is actually perl and the program runs and exits
normally. We might have to go with Ed's idea of duping and closing STDERR
before running the command, which isn't so bad.
Isn't cross-platform compatibility FUN?!
--
Michael G. Schwern <[EMAIL PROTECTED]> http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
I sit on the floor and pick my nose
and think of dirty things
Of deviant dwarfs who suck their toes
and elves who drub their dings.
-- Frito Bugger, "Bored Of The Rings"