in reply to UTFM - Use the Friendly Modules

I just don't understand the fear associated with using a module. the alternative is much scarier to me. decode CGI variables? parse HTML?

Scarier to you because you know better by now. Try looking at this from a complete Perl novice's position. They see basically two options:

  1. Use a module. First they have to understand exactly what a module is, then which one to use, then where to get it, then how to download it, then how to install it, then how to use it in their script.
  2. Ask for a regex or, at most, a few short lines of code (their perspective, not mine), insert it in their existing script, done.

For most tasks (especially param or HTML parsing) using a module is by far the better choice. Convincing someone of this is the hard part. To the uninitiated, your image tag example seems pretty simple, why would they need a module for it?

Obviously you can't spend an hour discussing the various flaws in a regex with every monk that comes along. If they choose to ignore your advice in the first place that's up to them. They'll either eventually get tired of fixing buggy code and use modules, or they'll continue to write buggy code and won't be any competition in the job market ;-).

Replies are listed 'Best First'.
Re: Re: UTFM - Use the Friendly Modules
by fuzzyping (Chaplain) on Mar 09, 2002 at 12:37 UTC
    I agree completely. As a former newbie myself, I remember my primary FUD with modules:

    1. How to install? Although documentation on installing modules can be found, they're not always written for the newbie audience. I know that a lot of monks swear by the CPAN module. Yes, it's great when it works... but a frightening experience to a newbie when it doesn't. First, just installing the CPAN module can be an exercise in futility... the looping behavior with excessive output is just enough to make those little hairs on the back of your neck stand on end.

      When you finally get CPAN installed, there's no guarantee it's always going to work. Try installing Net::SSH::Perl using CPAN. Good Luck. Dollars-to-doughnuts it will die on IDEA.pm installation. Just an example, YMMV.

      Personally, I prefer to install my modules by hand. It's almost as easy (perl Makefile.pl && make && make test && make install) and really gives you a better idea of what's going on and where. I like to know what's being installed in my system, if it's conflicting with existing items, and if it has any dependencies (wash, rinse, repeat). Some of this need for control likely stems from my parallel concern with systems security.

    2. Using most modules does not require that you're comfortable with OOP, but it sure suggests it, if you want to get the most out of the module. Yes, that's the whole design and purpose behind CPAN... reusable code. Nevertheless, it's a daunting task to learn OOP just so you can use one specific module.

    That said, I still think that the installation of modules is by far the darker of the two. I think the community would be well served to come up with some good (newbie-ized) introductory documentation to installing Perl modules.

    -fuzzyping