I ran into something similiar, once... Have you checked to see if your end-of-line character is incorrectly set to '\r\n'? If your script starts with

#!/usr/bin/perl\r\n

it will be looking for a file called 'perl\r' in /usr/bin. Whereas

#!/usr/bin/perl -wT\r\n
Will actually work.

Do a quick 'hexdump -c filename' to see if this is the case.

Update: A bit more about the time I got bit by this.... I had a jr sysadmin working under me put a new 'ifcfg-eth0' to a soon-to-be-production machine with a buch of '\r's in it. It looked something like:

DEVICE=eth0\r IPADDR=xx.xx.194.149\r NETWORK=xx.xx.194.128\r NETMASK=255.255.255.128\r BROADCAST=xx.xx.194.255\r

When we cycled the machine right before deploying it, we lost remote connectivity (it was trying to configure the device 'eth0\r'. We had to go down to the colocation facility and debug if from there. The error message on the screen was 'eth0 no such device' (i.e 'eth0\r no such device') which wasn't particularly helpful. After cycling the machine numerous times and swapping out some hardware, someone noticed that emacs was labeling it as a DOS file. A quick 'perl -pi -e "s/\r//g" ifcfg-eth0' fixed it.

-Blake


In reply to Re: Turning *off* warnings causes the script to fail :( by blakem
in thread 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.