Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Why aren't my backtick calls working on Win32?

by Anonymous Monk
on Apr 04, 2000 at 23:55 UTC ( #6870=perlquestion: print w/replies, xml ) Need Help??

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://6870]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2021-04-19 09:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?