Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^4: Inside-out objects inheriting from hash-based classes

by jdhedden (Deacon)
on Dec 08, 2005 at 05:27 UTC ( #515137=note: print w/replies, xml ) Need Help??


in reply to Re^3: Inside-out objects inheriting from hash-based classes
in thread Inside-out objects inheriting from hash-based classes

In the case you describe, Borg::comment is overridden by Foo::comment, and, as a result of the architecture, is not directly callable using $obj->Borg::comment.

If it was intended by Foo's author that Borg::comment should be overridden, then no one should be writing code that uses Foo and also tries to by-pass Foo's version of the comment method.

If the overriding was accidently, then either Foo's author can rename Foo::comment, or can provide a wrapper method so that the functionality of Borg::comment is made available under a different name.

This is an interesting technical point, but I would imagine that a situation like this would rarely occur in practice. Nonetheless, I'll add information about this to the POD. Thanks.

Update: Actually, this applies to more than just overridden methods. You can't use any fully-qualified method calls to inherited foreign classes. But then again, you shouldn't need to.


Remember: There's always one more bug.
  • Comment on Re^4: Inside-out objects inheriting from hash-based classes

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://515137]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (2)
As of 2019-12-07 01:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (160 votes). Check out past polls.

    Notices?