--- Stevan Little wrote:
> I was writing tests for split(<regexp>, <str>) and I stumbled upon this
> bug:
> 
> pugs -e 'split(rx:perl5//, "not good")'
> 
> Will go into an infinite loop. I also tried the empty regexp in a match
> on it's own, and it was not a problem.

Further to that, I noticed that the somewhat arcane semantics of p5 split
are not honoured by Pugs. Since S29 split is not written yet I'm not sure,
but I expect p6 split will be p5 split compatible. For example, p5 split
retains leading empty fields, but lops trailing ones:

# cat s.pl
my $x = ":a:z:";
my @x = split(":", $x);
for (@x) { print "v='$_'\n" }

# perl -w s.pl
v=''
v='a'
v='z'

# pugs s.pl
v=''
v='a'
v='z'
v=''

The sometimes seemingly arbitrary semantics of p5 split seem to have become
something of a de facto standard, with even Java and .NET following suit
(I *think*, not certain about this and too lazy to check right now).

/-\


Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com

Reply via email to