On Oct-08, Dakkar wrote:
> I discovered the problem:
> 
>   print "Yes r\n" if "0" =~ /0/;
>   print "Yes s\n" if "0" =~ "0";
> 
> printed only "Yes s"
> 
> The problem is NOT in the RE engine, but in the string literal code in
> P6C/Tree/String.pm
> 
> I replaced some "if ($stuff)" with "if (defined $stuff)" and now it
> works. The problem was that a string "0" is false, but it's not the
> same as "" (which would get used instead).
> 
> Proof:
> 
>  print "0";print "\n";
> 
> prints an empty line.
> 
> I attach a small patch: it's quite possible that by adding 'defined'
> in several places I broke something else. People familiar with the
> code will undoubtedly correct my patch.

Looks good as far as I can tell. Applied, thanks.

Reply via email to