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

Re: How a script becomes a module

by hossman (Prior)
on Oct 05, 2004 at 22:30 UTC ( #396802=note: print w/ replies, xml ) Need Help??


in reply to How a script becomes a module

Nice writeup, but something looks off to me. in th section "Oops, I did it again" you have the line...

print "High score is " . Local::Scores->high_score( $scores ) . "\n";

...but the variable $scores doesn't exist (at least not in that version ... i think you ment to change that so it takes in @players).


Comment on Re: How a script becomes a module
Select or Download Code
Re^2: How a script becomes a module
by brian_d_foy (Abbot) on Oct 05, 2004 at 22:36 UTC

    You're right: that $scores doesn't belong there. I get away with it though because I don't show you the implementation of high_score(), which only needs the instance data to get at the database.

    I've updated the code.

    --
    brian d foy <bdfoy@cpan.org>

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2014-09-19 04:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (129 votes), past polls