Perl "Shebang"
am 06.11.2007 13:59:29 von Bill HCan anyone tell me what the "--" means in this line:
#!/usr/bin/perl --
This is part of a forum script (YaBB). I haven't see just -- before
Bill H
Can anyone tell me what the "--" means in this line:
#!/usr/bin/perl --
This is part of a forum script (YaBB). I haven't see just -- before
Bill H
Bill H
@o80g2000hse.googlegroups.com:
> Can anyone tell me what the "--" means in this line:
>
> #!/usr/bin/perl --
>
> This is part of a forum script (YaBB). I haven't see just -- before
C:\Temp> perl -h
Usage: C:\opt\Perl\bin\perl.exe [switches] [--] [programfile] [arguments]
Clearly, it marks the end of command line switches.
My guess is, YaBB authors used it to protect against accidental binary FTP
transfers between Windows and Unix EOL based systems mucking up the shebang
line.
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
clpmisc guidelines:
Bill H wrote:
> Can anyone tell me what the "--" means in this line:
>=20
> #!/usr/bin/perl --
>=20
> This is part of a forum script (YaBB). I haven't see just -- before
Usually '--' on a command line means that anything after that will *not* =
be considered an option, even if it begins with '-'.
I don't know YaBB and how it calls the script, but I guess that the=20
script might be called with additional parameters which may be provided=20
by the user, and this construct prevents the unwanted interpretation of=20
a leading '-' in the first argument.
--=20
These are my personal views and not those of Fujitsu Siemens Computers!
Josef Möllers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)
Company Details: http://www.fujitsu-siemens.com/imprint.html
Bill H wrote:
>
> Can anyone tell me what the "--" means in this line:
>
> #!/usr/bin/perl --
>
> This is part of a forum script (YaBB). I haven't see just -- before
On the command line it means that there are no more program switches
(options) to the right of --, everything following -- is data only.
In a program like that it is used as a guard against extraneous
whitespace confusing the operating system. For example, if you edit the
script in Windows and then try to run it in *nix.
John
--
use Perl;
program
fulfillment