in reply to Re^2: Report on Blessing to 'tag' an object
in thread Report on Blessing to 'tag' an object

That won't always work:     Can't locate Scalar/Util.pm in @INC Which do you think is more likely? 1) That I blessed a non-array reference into the package named 'ARRAY' and I'll be upset that UNIVERSAL::isa() gets confused or 2) That I don't have Scalar::Util ?

I think Scalar::Util has become "core" and so in a few years, the probabilities will shift. For now, I much prefer UNIVERSAL::isa() because I like my code to work on relatively old versions of Perl and I don't mind that it is possible to break my code by doing extremely stupid things. q-:

                - tye

Replies are listed 'Best First'.
Re^4: Report on Blessing to 'tag' an object
by adrianh (Chancellor) on Jan 21, 2003 at 17:13 UTC

    Fair point :-)

    Scalar::Util has been core since 5.007003 for those interested.

    Personally, I prefer catch the weird cases - even if I have to install a few modules to do so.

      This particular module should be useful without other (non-core) dependancies, and should run on Perl 5.6. There is another place Scalar::Util would come in handy (to distinguish a floating-point literal from a string literal), but I'm trying to do without.

      I thought about using isa rather than ref, but figured the latter is faster and I know exactly what the possibilities are. That is, I won't see a derived class coming back in.

        If you are that concerned about module dependencies there is always the option of a copy 'n' paste of the pure perl version :-)