Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Production Environments and "Foreign" Code

by adrianh (Chancellor)
on Mar 12, 2003 at 14:50 UTC ( #242370=note: print w/replies, xml ) Need Help??

in reply to Production Environments and "Foreign" Code

I've used a lot of CPAN modules in production code. CPAN is probably the primary reason I use perl for most of my work since it enables me to build quality apps quickly. Not using CPAN is... foolish :-)

The important thing is to have some sort of process. My general rules when using other peoples modules are:

  • Look for a test suite. If there isn't one be wary. Strongly consider writing one before you start using it :-)
  • Review the code.
  • Consider wrapping all the external code in a proxy so you can swap it out easily if necessary.
  • Make sure your integration tests exercise all the modules, not just the ones you wrote.
  • Keep an eye on CPAN for updates. Other people fix bugs (isn't it great :-)
  • Do not blindly update to the latest version of a module when it hits CPAN. Read the changelog. Run a diff against the one used on the production machine. Run regression tests.

Even if you do all of the above it will still take less time than writing something like DBI or Template from scratch.

I've only very occasionally had problems. Some of the non-upward compatable changes made to Class::DBI being the only ones that ever caused serious hassles - and that was because somebody else ignored the last point above :-/

Hope this helps.

  • Comment on Re: Production Environments and "Foreign" Code

Replies are listed 'Best First'.
Re: Re: Production Environments and "Foreign" Code
by PodMaster (Abbot) on Mar 12, 2003 at 15:04 UTC

    I absolutely refuse to install any module without a test suite (and I hate changelogs which lie -- diff is key).

    Another tip is to not rule out modules with artificial requirements.

    A module may say use Foo 5.5, but that may be only because that's the version they had installed (test anyway).

    Also, you can find lots of useful modules which could work with your version of perl, if they used the vars pragma instead of our $VERSION = 3.1;.

    MJD says you can't just make shit up and expect the computer to know what you mean, retardo!
    I run a Win32 PPM repository for perl 5.6x+5.8x. I take requests.
    ** The Third rule of perl club is a statement of fact: pod is sexy.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2021-04-18 15:52 GMT
Find Nodes?
    Voting Booth?

    No recent polls found