in reply to Re (tilly) 3: Dice::Dice
in thread Dice::Dice

I have a question concerning this comment of yours,

Default values are something that is good to make a method from if you want them inherited in an override. His implementation of defaults tries to do that but will blow up because he will try to be using a symbolic reference and has strict on.

Inheritance is everything in this module so I'm trying to grok this. My english2perl isn't what it should be (yet). While I was working on this I made sure that Dice::di's roll method was inherited into Dice::Dice before I overroad it, and I had no problem. So obviously you are trying to warn me of something I don't know how to identify in the code.

Please help in assisting the blind to see,

coreolyn

Replies are listed 'Best First'.
Re (tilly) 5: Dice::Dice
by tilly (Archbishop) on Jan 09, 2001 at 01:00 UTC
    The following code is what bothered me:
    my %defaults = $caller_is_obj ? %$caller_is_obj : %_default_data;
    Instead of that do the following:
    my %defaults = $caller->get_default();
    and in your module define a get_default() method that returns the same data you put in %_default_data.

    Either that or change to:

    my %defaults = $caller_is_obj ? %$caller : %_default_data;
    (which upon reflection is more likely what you meant).