in reply to Death and Return of TIMTOWTDI
I would prefer it if the first answer was not "look on CPAN, and don't attempt to try yourself."
As others have pointed out, that's not always the first answer. The "look on CPAN" answer does tend to get used when people start asking: "How do I handle this corner case? What about this special situation?" It is exactly this sort of "institutional knowledge" that a repository such as CPAN is perfect for accumulating.
The other reason that long-time users often resort to telling novices to "use CPAN" is because they want to provide a working solution, but they don't have the time or energy to teach the novice all the way up through the ranks.
Finally, I find that there are many modules on CPAN that are right at the boundary where "work required to understand the interface" is just about equal to "work required to replicate their functionality 'by hand'".
What tends to happen is that it is easier to open-code a solution that handles 90-95% of the cases; it's those last few percentages that require ugly special code, pleas to Seekers of Perl Wisdom, and responses to "use CPAN" and/or "let's make that a module".
The latter, however, eventually grows enough hair that when the next novice comes along, looking to solve the first 90% of their problem, says "wow, that module's too complex, I can just solve it with my own code like so..."
|
---|