in reply to Turning *off* warnings causes the script to fail :(

Strange but no one's mentioned trying to resolve the potential source of the problem itself. I've recently installed RedHat 7.1 on a machine, and also inadvertantly installed 2 versions of Perl (5.6 and 5.6.1). I, too, had the same "it works from the command-line it bombs from the webserver" problem. I fixed everything by going to /usr/bin and then doing a "./perl -MCPAN -e shell" to upgrade the 5.6 (in /usr/bin) which also had the affect of overwritting the 5.6.1 in /usr/local/bin. Once I was down to one version of Perl everything worked as expected. No weirdness. Unless you have a desperate need for two versions of Perl you might give that a try and see if it helps.

Gary Blackburn
Trained Killer

  • Comment on Re: Turning *off* warnings causes the script to fail :(

Replies are listed 'Best First'.
Re (tilly) 2: Turning *off* warnings causes the script to fail :(
by tilly (Archbishop) on Aug 21, 2001 at 16:38 UTC
    That has nothing to do with the problem.

    The problem here is, "It works when explicitly invoked with perl, but fails when launched as an executable." The reason in this case appears to be a DOS line ending causing a carriage return to be seen as part of the interpreter's name.

      We don't know that for sure just yet... it *could be* a DOS line ending problem, but it *could be* a multiple perl version issue. We still haven't heard back from Ovid on whether any of the suggestions mentioned solves the problem.

      Basically, he needs to use "od -c somescript.cgi" to see if the first line shows a \r on the first line of the script, and he needs to try running from the command line both "/usr/bin/perl somescript.cgi" and "/usr/local/bin/perl somescript.cgi" to make sure they both produce the same results.

      In any the case, lets not get jumpy about it. All the suggestions so far are good ones.

      Zucan

        Adding command line switches (eg warnings) will fix a DOS line ending problem but won't fix a multiple Perl version issue. Therefore it is not a multiple Perl version issue.

        But note that using od is overkill. On Linux if you vi the file, you will see carriage returns as ^M. Also note that rather than guessing where an alternate Perl version might be, you are better off running:

        which perl
        or by running the script:
        use Config; print Config::myconfig();
        in various ways.