Grokbase
Topics Posts Groups | in
x
[ help ]

Re: Too late for -Co

View PostFlat  Thread  Threaded | < Prev - Next >
A. Pagaltzis Re: Too late for -Co
| +1 vote
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
Hi Nicholas,

* Nicholas Clark <nick@ccl4.org> [2008-03-25 23:00]:
> Someone else correct me if I'm wrong, but as I understand it,
> if you start your script ./rakkk
>
> #!/usr/bin/perl -w
>
> then often perl is invoked by the shell as
>
> /usr/bin/perl -w ./rakkk

no, it’s the kernel that does that, automatically. The shell has
nothing to do with it.

The reason perl parses the switches again is that it might be
invoked in some other fashion than implicitly via the shebang
under a Unixoid kernel; eg. the user types `perl ./rakk` into
the shell. In such a case, the shebang line options would fail
to have an effect if perl didn’t parse them.

> and that -w is set and processed before the script is opened.
> But then perl reads in the first line of the script, and
> processes the -w again (using Perl_moreswitches()). But for all
> the command line options that can be used on the #! line, it
> doesn't matter if they are processed multiple times)

Yeah, that’s why you can’t use -M on the shebang line. It’s also
obvious why you can’t use -T, even though that’s for a different
reason. It’s not so obvious why 5.10 has promoted -C to this
club, though.

Regards,
--
Aristotle Pagaltzis // <http://plasmasturm.org/>

Thread : Too late for -Co
1)
Alberto Simões Hi, Folks. I had some CGI scripts using #!perl -CoO Now, with perl 5.10.0 I can't do that. What is...
2)
Nicholas Clark IIRC it didn't ever actually work on 5.8.x. (If so) if you take it out, does anything change?...
3)
Alberto Simões It worked with 5.8.8 ...
4)
A. Pagaltzis Hi Nicholas, no, it’s the kernel that does that, automatically. The shell has nothing to do with...
5)
Alberto Simões using binmode STDOUT, ":utf8" Thanks > ambs...
6)
A. Pagaltzis use open OUT => ':utf8', ':std'; Regards,
spacer
View PostFlat  Thread  Threaded | < Prev - Next >
Home > Groups > Perl 5 Porters > Too late for -Co (6 posts) > View Post