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

Pushed revert_skipwhite - improve handling of split special cases

From:
demerphq
Date:
March 27, 2013 07:50
Subject:
Pushed revert_skipwhite - improve handling of split special cases
Message ID:
CANgJU+Uq5+mttfbvC+JPojh_7-YbVvL-mqH9VCi3fmdD11LLEg@mail.gmail.com
I pushed the yves/revert_skipwhite even tho I think there was one
failed smoke (and multiple passes).

I wanted to get it merged so more eyes could look into it and if
necessary help fix it. Also to get cpan smoke reports on it.

It passed all tests on my box so I hope it doesn't cause any
significant trouble.

This makes some improvements to split. The special case is no longer
restricted to split ' ', $thing only, but to any case where the
argument to split is a bare string, regardless of whether this is an
expression or not.

This means that these are the same

@x= split 0||' ', $thing;
@x= do { $x=0; split $x||' ', $thing };

as are these:
@x= $x ? split ' ', $thing : split /\s+/, $thing;
@x= split $x ? ' ' : qr/\s+/, $thing;

It also fixes some apparent issues with regex caching which were
exposed by the new RXf_PMf_SPLIT flag.

Sorry if this causes any trouble! Patches welcome!

cheers,
Yves

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"



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