Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: How to implement a Design Pattern/ Strategy??

by chromatic (Archbishop)
on Jun 13, 2011 at 02:54 UTC ( [id://909324]=note: print w/replies, xml ) Need Help??


in reply to Re^2: How to implement a Design Pattern/ Strategy??
in thread How to implement a Design Pattern/ Strategy??

I was going to make a subroutine, just wasn't sure if I should put everything in it, or only the parts that were **exactly** the same...

Subroutines are useful for avoiding repetition, but the best thing about subroutines is that they let you extract and name a little bit of behavior. Most of my small, single-file programs start out with me declaring main() and then calling a bunch of smaller subroutines from there. I fill them in as I go, and I use their names to describe what they do.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2026-04-10 15:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.