http://qs321.pair.com?node_id=6870

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

I'm running perl on NT and can't get the output of my other programs thru the use of backticks.
Example:

test1.pl --------
#! c:\perl\bin\perl print "Hello World!";
---------

test2.pl ---------<br> #! c:\perl\bin\perl.exe $output1 = `test1.pl`; print "Option 1: ".$output1."\n"; open(STDOUT, ">output"); # from perlfaq8 system("test1.pl");
---------

Results:
---------
Z:\test> test2.pl Option 1: Z:\test> type output Z:\test>
---------- Any suggestions?

Replies are listed 'Best First'.
Re: Why aren't my backtick calls working on Win32?
by bsb (Priest) on May 24, 2004 at 08:00 UTC
    I had to add the -S switch to find the script file:
    `perl -S script.pl`
Re: Why aren't my backtick calls working on Win32?
by btrott (Parson) on Apr 05, 2000 at 00:28 UTC
    Try changing your backticks to:
    $output1 = `perl test1.pl`;
    I tried it, and it fixed the problem for me.
Re: Why aren't my backtick calls working on Win32?
by chromatic (Archbishop) on Apr 05, 2000 at 02:00 UTC
    I had the same problem, and fixed it by prepending "perl " to the filename. My guess is that you don't have an association set up for the .PL file extension and the Perl executable.