JD,

What you write isn't true, unless your umask is set to an odd value (I
mean 'odd' both literally and figuratively).  Did you try it?  "perl
temp.pl" will work, but "./temp.pl" won't--you can only execute an
executable file.  In the "perl temp.pl" case, temp.pl isn't being
"executed"--it's "data" that the program "perl" is doing something with
(and that "something" just happens to look suspiciously like
execution...).

There is no mechanism whereby you can remove the shebang line and still
cause Perl to be invoked--how can the OS possibly know that the script is
a Perl script?  (The .pl, perhaps, but what if you have several perls on
this machine, which gets run?)

(I take it back, there *is* a mechanism, and it's described in the Camel
book.  But it's meant for OS's that don't support the shebang--which does
not include OS X.)

Trey

In a message dated Sun, 24 Apr 2005, John Delacour writes:
> At 7:53 pm +0200 24/4/05, Marc Manthey wrote:
>
> >when i type:
> >
> >marxg4:~ marxg4$ chown -R marxg4 /Users/marxg4/Desktop/dbeacon
> >chown: /Users/marxg4/Desktop/dbeacon: Operation not permitted
> >
> >"Operation not permitted"  ....what can i do ?
> >
> >The programm needs no administrator rights.
>
> Here are two ways to run temp.pl after creating it:
>
>
> Eremita:~ jd$ cd
> Eremita:~ jd$ echo '#!/usr/bin/perl
> print qq~hello\n~;' > temp.pl
>
> Eremita:~ jd$ perl temp.pl
> hello
> Eremita:~ jd$ ./temp.pl
> hello
> Eremita:~ jd$
>
> The file does not need permissions changed in this case.
>
> If you omit the shebang the first method will work but not the second:
>
> Eremita:~ jd$ echo "print qq~hello\n~" > temp.pl
> Eremita:~ jd$ perl temp.pl
> hello
> Eremita:~ jd$ ./temp.pl
> ./temp.pl: line 1: print: command not found
> Eremita:~ jd$
>
> If you need to change the permissions on temp.pl to make it executable, then
>
> chmod +x temp.pl
>
>
> JD
>
>
>

-- 

Reply via email to