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

Re: [perl #108780] overload::StrVal and qr//

Thread Previous | Thread Next
From:
Ricardo Signes
Date:
January 25, 2012 09:21
Subject:
Re: [perl #108780] overload::StrVal and qr//
Message ID:
20120125172056.GB15810@cancer.codesimply.com
* demerphq <demerphq@gmail.com> [2012-01-25T11:44:53]
> 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");

What do you think about the suggestion that embedding a regexp object in
another regexp under "no overloading" is like doing almost anything with ($x =
undef) under "use undef::stringification"?

-- 
rjbs

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About