knsridhar has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I was wondering what would be the advantages and disadvantages of installing perl modules as source/binary installation.
And i though i could ask perlmonks about this.

Thanks

Replies are listed 'Best First'.
Re: Source Vs Binary Installation
by Zaxo (Archbishop) on Oct 03, 2005 at 11:09 UTC

    Most perl module installations just involve moving text files. Their "source" is what perl runs. Building from the tarball is slightly more reliable since the installation locations are localized by perl and CPAN.pm.

    Some modules use XS or other foreign code, frequently for loading and call system libraries. I prefer to build those from source. That way I know that the C compiler or whatever is compatable with my perl and system libraries.

    After Compline,
    Zaxo

Re: Source Vs Binary Installation
by polypompholyx (Chaplain) on Oct 03, 2005 at 13:48 UTC
    I'd say it somewhat depends on the OS you're using. If you're on a Unix of some description, then it's usually easy to make and install modules yourself from source, since you'll likely have gcc, and can therefore deal with pure Perl and XS modules with equal alacrity. If you're on Windows, you may find it easier to use a binary port of perl like the one from ActiveState, and install modules from binary distributions using their PPM tool. There are a few problems with this: the PPM distributions are sometimes out of date or missing; the latest version doesn't seem to update the HTML documentation when you install modules any more; and you can't use certain modules properly (like Inline). If this bugs you, you could always compile perl yourself with Mingw, Microsoft's VCToolkit, or run it inside Cygwin.
Re: Source Vs Binary Installation
by jbrugger (Parson) on Oct 03, 2005 at 12:33 UTC
    using Debian stable, i try to use as much binaries as possible, and compile the ones not there / too old in the Debian distribution. (trying the 'testing / unstable versions first).
    A simple apt-get update / apt-get dist-upgrade keeps me up-to date.
    Drawback is, i don't have the 'cutting-edge' new modules there might be on cpan. For example using HTML::Template::Expr from the Debian distro was old, so did not have the nice javascript escape routines.
    There are allways pro's and con's making this kinds of selections.

    "We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.
Re: Source Vs Binary Installation
by duckyd (Hermit) on Oct 03, 2005 at 18:55 UTC
    If you have an easy to update binary packaging system, like Debian's apt, and don't need features (or bug fixes) only available in versions of a module not avaiable via your packaging system, it is very convenient to use binary packages to install and update perl modules. There are quite a few caveats though...
Re: Source Vs Binary Installation
by rinceWind (Monsignor) on Oct 04, 2005 at 10:48 UTC

    This is the subject of a talk I gave recently at YAPC Europe.

    --

    Oh Lord, won’t you burn me a Knoppix CD ?
    My friends all rate Windows, I must disagree.
    Your powers of persuasion will set them all free,
    So oh Lord, won’t you burn me a Knoppix CD ?
    (Missquoting Janis Joplin)