Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Inheritance and merging of fields

by nite_man (Deacon)
on Jul 25, 2006 at 10:47 UTC ( #563476=perlquestion: print w/replies, xml ) Need Help??

nite_man has asked for the wisdom of the Perl Monks concerning the following question:

Hi,
I have a very strange (at least for me) problem with OO Perl. I have following hierarchy of classes:
Class A is base class, class B is a child of A, class C is child of B. Each class has its own list of fields which should be merged in case of object C. It works fine but in one case (it's application specific case, so, I cannot put there the code) when object C is created only its fields are in the %FIELDS.
Does somebody has some idea why it happens?
Thanks in advance.

---
Michael Stepanov aka nite_man

It's only my opinion and it doesn't have pretensions of absoluteness!

Replies are listed 'Best First'.
Re: Inheritance and merging of fields
by davorg (Chancellor) on Jul 25, 2006 at 10:53 UTC

    Without seeing any code, it's impossible to give any reasonable level of help. Would it be possible for you to create a cut-down but complete example that exhibits the problematic behaviour that you describe?

    --
    <http://dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

      I agree with with you but the problem is when I try to reproduce this problem using some simple case, let say, create a scrit and create the object C there, everything works fine. But if I get you the code it takes 5 - 10 screens and week to understand how it works.
      Maybe you have some suggestions how to trace it?

      ---
      Michael Stepanov aka nite_man

      It's only my opinion and it doesn't have pretensions of absoluteness!

        Well, if you have a cut-down version that works and a full version that doesn't, then why not start with the cut-down version and slowly add code from the full version until it breaks.

        --
        <http://dave.org.uk>

        "The first rule of Perl club is you do not talk about Perl club."
        -- Chip Salzenberg

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2021-06-23 20:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (122 votes). Check out past polls.

    Notices?