develooper Front page | perl.perl5.porters | Postings from July 2009

RE: [PATCH] Remove implicit split to @_

Thread Previous | Thread Next
From:
Jan Dubois
Date:
July 11, 2009 21:00
Subject:
RE: [PATCH] Remove implicit split to @_
Message ID:
022401ca02a5$3e7ba370$bb72ea50$@com
On Fri, 10 Jul 2009, Abigail wrote:
> On Fri, Jul 10, 2009 at 02:42:01PM -0700, Chip Salzenberg wrote:
> > When Perl 5.12 encounters scalar split and *not* under C<use 5.012>, it should
> > either do 5.10 does, or die.  Those are the only two options that make sense
> > if you're trying to make a usable tool.
> 
> Please. We have been through this. We really don't want programs to change
> their behaviour in subtle ways if the 'use 5.12' line disappears.
> That is, IMO, worse than the scenario you paint above.

I agree with this as far as the "do what 5.10 does" is concerned. But
dying is more than just subtly different from returning a count. :)

I actually find that the best solution: scalar split in 5.12 and later will
just die.  This is acceptable because that feature has been deprecated for
a long time and is now gone.

But if you add "use 5.012" then you enable the *new* feature: split in
scalar context returns the count but doesn't update @_.  This may look
surprisingly similar to the old feature, but it *is* different, and it
doesn't work correctly on older Perl versions, so I don't know why it
should not be disabled unless you ask for 5.012 or later.

Cheers,
-Jan


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