develooper Front page | perl.perl5.porters | Postings from May 2003

Re: [PATCH] Extra newline in stringified qr/\#/x

Thread Previous | Thread Next
From:
Enache Adrian
Date:
May 30, 2003 17:46
Subject:
Re: [PATCH] Extra newline in stringified qr/\#/x
Message ID:
20030531004826.GA1178@ratsnest.hole
On Fri, May 30, 2003 at 04:25:48PM +0100, Orton, Yves wrote:
> Although the fact is that stringification of Regexes in perl is partially
> broken (or was the last time I looked at the source.) For instance 
> 
> #!perl -l
> my $funky=bless qr/The invisible regex!/,"flintstone";
> print ref($funky);
> print "$funky";
> print "The invisible regex!"=~$funky;
> bless $funky,"Regexp";
> print ref($funky);
> print "$funky\n";
> __END__
> flintstone
> flintstone=SCALAR(0x1acf02c)
> 1
> Regexp
> (?-xism:The invisible regex!)
> 
> Even the magic pointer is still there the stringification lookup is
> hardcoded against the package 'Regexp'.

In bleadperl it gives:

flintstone
(?-xism:The invisible regex!)
1
Regexp
(?-xism:The invisible regex!)

(IIRC, there's even a testcase for that)

Regards,
Adi

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