I'm a relatively new to Linux, so I'm in over my head here. I'm having a problem with a shebang line and multiple versions of Perl.

One of our scripts runs fine from the command line but wouldn't run through the browser. We'd type

perl somescript.cgi

and everthing would run fine.

However, when we tried

./somescript.cgi

we would get a "No such file or directory" error. The shebang line was #!/usr/bin/perl and sure enough, there is a /usr/bin/perl out there.

After copying a shebang from another script, we discovered that it would run perfectly by enabling warnings (wtf???). Shebang:

#!/usr/bin/perl -wT

Take out the -w and the script won't run. /usr/bin/perl has perl 5.6.0. We discovered that we also have a /usr/local/bin/perl which is version 5.6.1 (which could be a red herring). I'm trying to figure out if there is some version conflict going on here, though I don't see how.

Anyone run across a problem like this before? We're running RedHat Linux version 7.0. Perl 5.6.1 was installed after the RedHat install.

Cheers,
Ovid

Vote for paco!

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.


In reply to Turning *off* warnings causes the script to fail :( by Ovid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.