On Wednesday, August 28, 2002, at 11:36 , Beau E. Cox wrote:
[..]
> For perl script 'x'
>
> ls -l x
>       -rwxr-xr-x    1 root     root           41 Aug 28 08:13 x
> cat x
>       #!/usr/bin/perl
>       print "Hello world\n";
> ../x
>       bash: ./x: bad interpreter: No such file or directory
> perl x
>       Hello world...
>

I'll bet you that your 'x-file'[1] has the usual 'EOL'
problem... where if you 'dump' the file you will find
that there is a "special" "^M" character 'attached' to
the end of perl as in

        #!/usr/bin/perl^M

which of course linux will take 'literally' and look
for the file

        /usr/bin/perl^M

which does not exist...

plan A:

        man dos2unix

and simply correct that.

plan B:

        #!/usr/bin/perl -w^M

will actually majikally work... since the perl code
is, well, promiscuous and will see that as a peculiar
'dos' like commandline ending but still suck in the
command line option.... and then read the rest of the
file as 'perl code' to be compiled and run....

ciao
drieux

---

[1] They made me do that joke....



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to