|
|
| "be consistent" | |
| PerlMonks |
SVN::Client subclassing issueby tj_thompson (Scribe) |
| on Sep 27, 2011 at 17:32 UTC ( #928123=perlquestion: print w/ replies, xml ) | Need Help?? |
|
tj_thompson has asked for the
wisdom of the Perl Monks concerning the following question:
Hello monks, I'm trying to subclass SVN::Client but I'm running into an issue that I haven't been able to figure out. First off, here's some code. Note that I've obviously removed the correct URL/user/pass information so it will be hard to check this code unless you have SVN::Client and a repo to play with.
The problem I'm having is with the ls wrapper function in sub. Run as is here (with valid url/user/pass, of course) I get the following output:
However, if instead of instantiating my subclass I change the Sub->new call to SVN::Client->new, I get this:
Now it works. This tells me that the arguments to the function are good since they're identical in both the direct SVN::Client::ls call and the Sub::ls wrapper function. The question is what's happening in the subclass wrapper function. I've verified the arguments are indeed being passed as expected, identical to the arguments to the direct SVN::Client->ls call I have put a lot of time into trying to solve this, but no luck as of yet. Am I somehow subclassing this wrong? Am I making the call via SUPER incorrectly somehow? My simple subclass and SUPER tests seem to work, indicating my syntax and methodology here seems to be correct. In any case, I genuinely appreciate any help you kind folks might give. EDIT: Here's something interesting. If I change the Sub::ls function like so:
It now works as expected. Exact same arguments and call, but it now works with the object being of the SVN::Client class instead of the Sub class. Calling $self->SUPER::ls from the Sub package should call the SVN::Client::ls function regardless of the class of the invocant (right?). Why is the class of the invocant affecting the results of the call here?
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||