develooper Front page | perl.beginners | Postings from April 2002

Re: I can't get this to run!

Thread Previous | Thread Next
From:
drieux
Date:
April 27, 2002 17:20
Subject:
Re: I can't get this to run!
Message ID:
BAFFC38B-5A3D-11D6-8C86-0030654D3CAE@wetware.com

On Saturday, April 27, 2002, at 03:20 , Shaun wrote:

>>  $ perl /usr/lib/cgi-bin/agbot/agbot.cgi
>
>> and it works just fine..  Huh?  I don't get it..
> That's because the shebang line is ignored when you prefix the script with
> the perl command.

you are correct - but I prefer to assert it the other way around,

when the perl interpretor is invoked with a file - it reads and
executes the perl way - hence #<foo> is parsed as comment and is
irrelevant.

when a 'script' is invoked - hence it is executable - it is passed
to the interpreter listed in the 'sheBang' - coming as we all know
from 'sharp bang' for the 'pound bang' - "#!" that precedes the
interpretor on line one - on some systems one could invoke 'the
default interpretor' - which was 'configurable' by putting

	":"

on line one.

which 'auto runs' the file as

	<interpretor> <file_invoking_interpretor>

the fun of course is to Zone Out and do:

	sh foo.pl

and watch /bin/sh freak at the perl code

or
	perl foo.sh

and watch the perl compiler errors...


ciao
drieux

---


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About