develooper Front page | perl.perl5.porters | Postings from March 2008

Re: Too late for -Co

Thread Previous | Thread Next
Nicholas Clark
March 25, 2008 14:55
Re: Too late for -Co
Message ID:
On Tue, Mar 25, 2008 at 09:33:28PM +0000, Alberto Simes wrote:
> Hi, Folks.
> I had some CGI scripts using
> #!perl -CoO
> Now, with perl 5.10.0 I can't do that.
> What is the preferred solution?

IIRC it didn't ever actually work on 5.8.x. (If so) if you take it out, does
anything change?

(What might be more accurate is that it doesn't work at the time of the perl
interpreter's #! line processing, but if the invoking program is the shell, and
processes that first line itself, to add options to the C argv passed to the
perl interpreter, then *that* would be setting them.

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

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)

Nicholas Clark

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About