in reply to How to use object's reference in "object" context if being used in scalar context it does something wrong?

ref should still get you the object class. I don't know how to get a unique identifier, but perhaps anothermonk does.

  • Comment on Re: How to use object's reference in "object" context if being used in scalar context it does something wrong?

Replies are listed 'Best First'.
Re^2: How to use object's reference in "object" context if being used in scalar context it does something wrong?
by v_melnik (Scribe) on Jul 08, 2014 at 14:49 UTC
    As I've got to know, Scalar::Util can be a bit helpful with refaddr(). Not the best solution for me, though. :(
    V.Melnik

      Try the overloading pragma...

      use strict; use warnings; use XML::LibXML 2; my $doc = XML::LibXML->load_xml(IO => \*DATA); my $bar = $doc->getElementsByTagName('bar')->get_node(1); print $bar, "\n"; { no overloading; print $bar, "\n"; } print $bar, "\n"; __DATA__ <foo><bar /></foo>