in reply to Re: Re: Blessables -- What Can You Make Into Objects?
in thread Blessables -- What Can You Make Into Objects?

Actually stringifying a regex does not return a string that contains "Regexp". It will look like any other scalar reference that has been stringified. (Youre thinking of what ref() would return.)

Thats part of the problem...

:-)

Yves / DeMerphq
---
Writing a good benchmark isnt as easy as it might look.

  • Comment on Re: Re: Re: Blessables -- What Can You Make Into Objects?

Replies are listed 'Best First'.
Re: Re: Re: Re: Blessables -- What Can You Make Into Objects?
by Anonymous Monk on Apr 26, 2002 at 22:14 UTC
    But that's why I overloaded stringification to contain 'Regexp' instead of 'SCALAR', because we still want ref() to return the classname and we want some way to determine of our blessed object is a Regexp type right?
      Ah. I should have read your code closer. Apologies.

      Nice trick, but I need this to work for any arbitrary classname. This is for a new Data::Dumper module. Er, for that matter Data::Dumper has the same problem:

      use Data::Dumper; my $x=bless qr/dedum/,'foo'; print Dumper($x); __END__ $VAR1 = bless( do{\(my $o = undef)}, 'foo' );

      Yves / DeMerphq
      ---
      Writing a good benchmark isnt as easy as it might look.