Re: [MacPerl-WebCGI] need help with My first perl program
[email protected] (Sean Willard) Fri, 23 Aug 2002 13:37:10 -0700
| Newsgroups | perl.macperl.webcgi |
|---|---|
| Organization | AFU GmbH |
| Message-ID | <[email protected]> |
Bill Becker writes:
> At 21:45 +0200 08/23/2002, Detlef Lindenthal wrote:
> >
> >A statement
> > . test.pl
> >means: The lines of the file "test.pl"
> >are interpreted as UNIX statements.
> >But UNIX won't understand Perl statements.
> >
>
> Yes it will, because the first line of his script is the
> hash-bang/path of the perl interpreter.
>
> In general, this will work with nearly any unix. Even the OS/390 USS
> understands it.
Solaris 8 and bash certainly don't. I think you mean
./test.pl
For Bourne shell derivatives, ". " means "interpret the
following file as containing shell commands". The hash-bang
line is treated as a comment and ignored. The C-shell
derivative equivalent is "source <file>". In all shells,
"./test.pl" or "/opt/test.pl" means "run this executable" --
whether it's a Perl script, compiled object file, or what have
you.
Liming, you should be able to do either of these (assuming your
test.pl is in the directory /opt):
cd /opt
./test.pl
or
/opt/test.pl
Sean