Front page | perl.perl5.porters |
Postings from November 2009
Re: do SUBROUTINE(LIST)
Thread Previous
|
Thread Next
From:
Nicholas Clark
Date:
November 2, 2009 03:21
Subject:
Re: do SUBROUTINE(LIST)
Message ID:
20091102112135.GB77879@plum.flirble.org
On Thu, Oct 29, 2009 at 01:24:16PM +0000, Paul LeoNerd Evans wrote:
> On Tue, 27 Oct 2009 06:31:58 -0600
> Tom Christiansen <tchrist@perl.com> wrote:
>
> > Perl has never done
> > that to its users' code base before.
>
> [citation needed]
>
>
>
> #!/usr/bin/perl5.8.8 -C
>
> works fine
No it doesn't. It has subtle bugs.
> #!/usr/bin/perl5.10.0 -C
>
> dies with:
>
> Too late for "-C" option at - line 1.
>
>
> This one bit me in a lot of ways; such as having to insert all manner of
> binmode(STDOUT)'s into BEGIN blocks.
I'm sorry about that part. However, I shall quote Paul Johnson's excellent
summary of the situation from when you commented about this on the london.pm
list:
On Fri, 12, 2008 at 02:11:49AM +0200, Paul Johnson wrote:
> On Fri, Sep 12, 2008 at 12:28:22AM +0100, Paul LeoNerd Evans wrote:
> > On Thu, 11 Sep 2008 15:19:17 +0200
> > Paul Johnson <paul@pjcj.net> wrote:
> >
> > > since the standard streams are already set up
> > > at this point in the execution of the perl interpreter. You can use
> > > binmode() instead to get the desired behaviour.
> >
> > Waaait a moment.
> >
> > Why can't -C just call binmode itself?
> >
> > This is getting stupider by the moment.
>
> Weeeeell. As I recall (in other words, don't blame me if I'm wrong), the
> problem wasn't that it couldn't be made to work, but rather than no one could
> be found who had the time, ability and inclination to make it work. But
> stopping it being broken was easier.
>
> Perhaps you are that person? You certainly seem to be at least one third of
> the way there.
No-one replied to his message.
What that summary omits are some technical details
1: The implementation of -C is not as simple as binmode
2: There are corner cases, to do with how and when #! processing happens
3: The solution in 5.10.1 (to make -C processing work like -T processing)
gives 90% of the benefit, without hitting those corner cases.
Nicholas Clark
Thread Previous
|
Thread Next