Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: output of one program doesn't show in another on server

by gideondsouza (Pilgrim)
on Dec 18, 2012 at 16:25 UTC ( #1009423=note: print w/ replies, xml ) Need Help??


in reply to Re: output of one program doesn't show in another on server
in thread output of one program doesn't show in another on server

Thanks a million for your help guys

  1. I do have #!/usr/bin/perl on the top of my runthis.pl
  2. I'm running on RHEL/Apache2 on an AmazonEC2 instance.

I updated my code according to NetWallah and AnonymousMonk's suggestions, I get the following error as predicted:

Error running runthis.pl : No such file or directory at /var/www/html/abc.cgi line 15

My files are in this path : /var/www/html , this is where I've configured apache to run .cgi and .pl scripts. I changed my line like this:

my @ret = `\usr\bin\perl /var/www/html/runthis.pl`;

No Luck, still says No such file or directory.

  1. Forgive my stupidity here, is my absolute path formed wrong?
  2. I didn't quite understand how I should use the FindBin module mbethke mentions. Any clues here would be awesome. Thanks!


Comment on Re^2: output of one program doesn't show in another on server
Select or Download Code
Re^3: output of one program doesn't show in another on server
by AnomalousMonk (Abbot) on Dec 18, 2012 at 17:38 UTC

     qx// `` (backticks) is double-quotish-interpolating, so  \usr\bin\perl is really:

    >perl -wMstrict -le "print qq{'\usr\bin\perl'}; " Unrecognized escape \p passed through at -e line 1. 'Sinperl'

    (Were you using warn-ings?)

    Update: Oops... Fixed example code to include initial backslash. (And always, always avoid Sinperl!)

      Thanks very much for your reply. Forgive me but I don't fully understand your answer though. Should I trying using qx instead of backticks?
      Hey thanks so much. It works in the end. I updated the original post (top post) with my findings. Thanks so much.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2014-12-19 01:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (70 votes), past polls