On Thu Dec 13 09:32:33 2012, estrai wrote: > This is a bug report for perl from estrai@estrai.com, > generated with the help of perlbug 1.39 running under perl 5.17.7. > > > ----------------------------------------------------------------- > > Hi, > split() has a special case for " " and "\x20" so they work like \s+ > (see perldoc -f split for details) > In blead (also observed on 5.17.5) "\x20" doesn't seem to work as > documented. > > * " " works as expected: > > % perl -MData::Dumper -E '$_=" a b c "; print Dumper [ split " " > ]' > $VAR1 = [ > 'a', > 'b', > 'c' > ]; > > * "\x20" doesn't: > > % perl -MData::Dumper -E '$_=" a b c "; print Dumper [ split > "\x20" ]' > $VAR1 = [ > '', > '', > 'a', > '', > '', > 'b', > 'c' > ]; > > estrai. > On 5.16.0 (at least), I get different results from yours: ##### $ perl -MData::Dumper -E '$_ = "\x20a\x20b\x20c\x20";@r=split /\x20/;say Dumper \@r;' $VAR1 = [ '', 'a', 'b', 'c' ]; $ perl -MData::Dumper -E '$_ = " a b c ";@r=split /\x20/;say Dumper \@r;' $VAR1 = [ '', 'a', 'b', 'c' ]; ##### 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." Thank you very much. Jim Keenan --- via perlbug: queue: perl5 status: new https://rt.perl.org:443/rt3/Ticket/Display.html?id=116086Thread Previous | Thread Next