On 25 January 2012 17:20, Ricardo Signes <perl.p5p@rjbs.manxome.org> wrote: > * demerphq <demerphq@gmail.com> [2012-01-25T10:51:14] >> On 24 January 2012 03:03, Ricardo Signes <perl.p5p@rjbs.manxome.org> wrote: >> > * Father Chrysostomos <sprout@cpan.org> [2012-01-22T17:50:54] >> >> Is the overloading pragma new enough to change without breaking things? >> > >> > Making "do { no overloading; qr{foo} }" return a Regexp=REGEXP(..) string is a >> > bug fix. >> >> Just curious, but is that a ruling-from-on-high, or is it a fact? >> >> I really do wonder if no overloading in earlier perls would have >> behaved as you describe. >> >> This is of course totally orthagonal to this being a bug. > > In 5.10.1, overloading.pm existed and Regexp were still SCALAR. "no > overloading" did not get you the StrVal. This, I say, was a bug, too. Depends what you think about the following: $ cat testit.pl use strict; use warnings; use Test::More tests=>4; no overloading; my $qr1=qr/(foo)/; my $qr2=qr/(boo)/; my $qr3=qr/(loo)/; ok( (("foo" =~ $qr1) && $1 && ($1 eq "foo")), "Raw regex"); ok( (("boo" =~ /$qr2/) && $1 && ($1 eq "boo")), "Raw regex redux"); ok( (("xlooy"=~/x${qr3}y/) && $1 && ($1 eq "loo")),"Embedded regex"); ok("$qr1"=~/REGEXP/,"Sanity check"); $ ./perl -Ilib testit.pl 1..4 ok 1 - Raw regex ok 2 - Raw regex redux not ok 3 - Embedded regex # Failed test 'Embedded regex' # at testit.pl line 10. ok 4 - Sanity check # Looks like you failed 1 test of 4. Which I think I might call a bug. cheers, Yves -- perl -Mre=debug -e "/just|another|perl|hacker/"Thread Previous | Thread Next