The 95% of the times, I decide to create a module for a task before I actually write any piece of code. Another 4% of the times is when I face a task that I remember I already solved and I do some cut-&-paste-&-glue to create a module from the existing code.
...and the other 1%? It's when I save a quick&dirty script for using it again once or two times a year :-)
Ciao!
--bronto
The very nature of Perl to be like natural language--inconsistant and full of dwim and special cases--makes it impossible to know it all without simply memorizing the documentation (which is not complete or totally correct anyway).
--John M. Dlugosz