elementary? oooh, that hurts =)
but you are right, I should have been using -w




Peter Scott <[EMAIL PROTECTED]>
10/24/2001 10:03 AM

 
        To:     [EMAIL PROTECTED], [EMAIL PROTECTED]
        cc: 
        Subject:        Re: No such file or directory exists


At 09:01 AM 10/24/2001 -0500, [EMAIL PROTECTED] wrote:
>I'm working with my perl scripts in Linux and Windows.  my scripts were
>running fine when I ran them as "perl myscript.pl"
>
>but when I tried to execute the perl script using only its name
>(./myscript.pl) then I would get the message "No such file exists"
>I searched and searched until I found that there were ^M chars at the end
>of each line of my source.  These could not be seen with the text editor 
I
>was using, but could be seen using "cat -v myscript.pl"
>
>I also found a one line perl command that removes all of these 
characters,
>and then my script worked fine to run as "./myscript.pl".
>I don't have that command on this machine, but if anybody is having the
>same trouble, I could email them later with the command.
>
>What is the cause of these chars? Is it using a Windows editor to code
>these scripts, and then running them in Linux?

Bingo.  And I'll bet you're being naughty and not using the -w flag 
(unless 
you're being modern and using 'use warnings', in which case I take it back 

and then some).  Because the ^M at the end of the #! line is being taken 
as 
part of the invocation, and in order for you to get that error message, it 

would have to be taken as part of the path to perl, which means that you 
don't have any options following it.

>I'm curious to know the cause of this because I spent a good part of 2
>hours getting that problem sorted out.

Often the silliest things do have this effect.  That's why I mentioned 
this 
one (which can cause other errors) and other 'elementary' errors in my 
book.
Peter Scott
[EMAIL PROTECTED]
http://www.perldebugged.com



Reply via email to