in reply to Re^3: Code critique XS function for extracting a blessed regex's pattern.
in thread Code critique XS function for extracting a blessed regex's pattern.

Once you bless a Regexp into another class it isn't a Regexp anymore...

Nope. The magic doesn't go away. As you can see.

sub t { printf "%10s %s /%s/\n", $_[0], ($_[0]=~/$_[1]/ ? "=~" : "!="), $_[1]; }; $bqr=bless qr/^blessed$/,"Foo"; $qr=qr/^normal$/; foreach $rex ($bqr,$qr) { t($_,$rex) foreach qw(normal blessed); } __END__ normal != /Foo=SCALAR(0x1abf1d8)/ blessed =~ /Foo=SCALAR(0x1abf1d8)/ normal =~ /(?-xism:^normal$)/ blessed != /(?-xism:^normal$)/
In fact i think its considered a feature. The possibilities are kinda interesting. :-)

--- demerphq
my friends call me, usually because I'm late....

  • Comment on Re: Re: Re: Re: Code critique XS function for extracting a blessed regex's pattern.
  • Download Code

Replies are listed 'Best First'.
Re^5: Code critique XS function for extracting a blessed regex's pattern.
by adrianh (Chancellor) on Feb 06, 2003 at 02:06 UTC

    D'oh - learn something new every day! Thanks for putting this poor fool straight :-)

    (Moral - don't type code examples at 1am. Bad adrian)