in reply to system calls

I might be wrong, but I found that system calls under DOS/Win do not work well when the string to execute in in the brackets of sys. Here is my workaround:

#! C:\perl\bin\perl.exe my $file1 = "test1.txt"; my $cmd = "check.bat > C://$file1 2>&1"; system ( $cmd );
Hope this helps.

Update: Also, even in Windows, use // instead of \\

------------------------------------------
An idea is not responsible for the people who believe in it...

Replies are listed 'Best First'.
Re^2: system calls
by phaylon (Curate) on Apr 22, 2005 at 20:51 UTC
    Good to know. I thought about that first, but wasn't sure if windows can redirect it's error output like the bash.

    Ordinary morality is for ordinary people. -- Aleister Crowley
Re^2: system calls
by Anonymous Monk on Apr 22, 2005 at 20:51 UTC
    Hello,

    Thanks for the suggestion. I went ahead and tried that. It did not seem to help.