![]() |
|
Welcome to the Monastery | |
PerlMonks |
"Default" methodby v_melnik (Scribe) |
on Oct 08, 2014 at 12:15 UTC ( #1103159=perlquestion: print w/replies, xml ) | Need Help?? |
v_melnik has asked for the wisdom of the Perl Monks concerning the following question: Dear monks, I saw a cool trick that XML::LibXML, Throwable and some other libraries can do: when you try to get the value of the variable containing a reference to the object, you get the result of calling one of its' methods (for example as_string() instead of "SomeClass=HASH(0xdeadbeef)". How to do that? Thank you! UPD: Thank you for replies, the "overload" pragma is exactly what I need!
V.Melnik
Back to
Seekers of Perl Wisdom
|
|