develooper Front page | perl.perl5.porters | Postings from December 2012

Re: [perl #116086] split "\x20" doesn't work as documented

Thread Previous | Thread Next
Dave Mitchell
December 14, 2012 13:06
Re: [perl #116086] split "\x20" doesn't work as documented
Message ID:
On Thu, Dec 13, 2012 at 10:31:18PM -0500, Eric Brine wrote:
> On Thu, Dec 13, 2012 at 9:37 PM, James E Keenan via RT <
>> wrote:
> > Nonetheless, these results appear to fail to match the documentation in
> > a *different* way from yours, viz., they fail the specification that
> > "any leading whitespace in EXPR is removed before splitting occurs."
> >
> That only applies when you pass a *string* consisting of a space. You are
> passing a regex. The document is quite clear about this.

I can confirm that it broke between 5.17.4 and 5.17.5:

$ perl5174  -e 'print "[$_]\n" for split  "\x20", " a b  c " '
$ perl5175  -e 'print "[$_]\n" for split  "\x20", " a b  c " '

and that the old behaviour worked back until at least 5_004_05.

The Enterprise's efficient long-range scanners detect a temporal vortex
distortion in good time, allowing it to be safely avoided via a minor
course correction.
    -- Things That Never Happen in "Star Trek" #21

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