laziness, impatience, and hubris | |
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?? |
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.
In Section
Seekers of Perl Wisdom
|
|