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

Re: Too late for -Co

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
March 25, 2008 14:55
Subject:
Re: Too late for -Co
Message ID:
20080325215506.GW79799@plum.flirble.org
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


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