Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Re (tilly) 3: Dice::Dice

by coreolyn (Parson)
on Jan 08, 2001 at 23:45 UTC ( [id://50559]=note: print w/replies, xml ) Need Help??


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).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-04-20 03:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found