Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

In writing a Perl script to interface with VSS I came across a problem. I'm trying to execute a command formated like:

"J:\VSS\win32\ss.exe" cp "$/Some/Thing"

and doing: system('"J:\VSS\win32\ss.exe" cp "$/Some/Thing"'); doesn't do the trick.

I need to have the double quote around both the first and last items separately. I can get it to work by removing the quotes around the first or last item, but I would like to have the quotes around both.
Thanks.

Replies are listed 'Best First'.
Re: system commands in win32
by grep (Monsignor) on Jan 05, 2002 at 06:35 UTC
    Try  system('J:\VSS\win32\ss.exe','cp',"$/Some/Thing");

    Your single-quotes in  system('"J:\VSS\win32\ss.exe" cp "$/Some/Thing"'); cause the double quotes not to interpolate. So you are running the command
    C:\>"J:\VSS\win32\ss.exe" cp "$/Some/Thing";.

    HTH

    grep
    grep> cd pub grep> more beer
      I don't want it to interpolate "$/Some/Thing"(hence using the single quotes).