No such thing as a small change | |
PerlMonks |
Can't locate object method in my Moo based classby Lotus1 (Vicar) |
on Jan 04, 2016 at 22:05 UTC ( [id://1151892]=perlquestion: print w/replies, xml ) | Need Help?? |
Lotus1 has asked for the wisdom of the Perl Monks concerning the following question: This is my first non-trivial attempt at Perl object oriented programming. The code below is just a first attempt to get something simple working but I'm stumped. Goal: Add my own methods in my XML::LibXML derived objects. Problem: The method I added in SSEDocument can't be located when I run my test script. I want my method to be similar to findnodes. findnodes and findvalue are defined in XML::LibXML::Node. The documentation for XML::LibXML::Document states that it inherits all the methods from XML::LibXML::Node. If I make my own version of XML::LibXML::Node then the methods there won't be seen since XML::LibXML::Document will still inherit from XML::LibXML::Node. I don't understand why my method won't work when defined in SSEDocument. Can someone suggest a better approach?
testmyclass.pl
When I run this here are the results:
Back to
Seekers of Perl Wisdom
|
|