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

When considering whether and how to install a given pm, is it possible to know in advance whether the module uses only perl modules, or whether some new binaries will be involved? )Other than by getting and unpacking the tar file ...)

Replies are listed 'Best First'.
Re: cpan modules - pm only?
by Tanalis (Curate) on Sep 02, 2005 at 09:43 UTC
    If you look at the author's page on CPAN, you'll see a list of Registered Modules for that author (see here for an example).

    The codes after each module name indicate whether the module uses a combination of C and Perl (look for the 'c' flag) - for example, DBD::Sybase has flags of RcmOp.

    More information on these flags is here.

    I don't know if all modules on CPAN have these flags associated with them, though, so this may or may not help you :)

      Indeed, not all modules (far from all modules), are 'registered' and have those codes. In all other cases, you can just browse the package on CPAN. Just follow the browse link (in your example: browse). Then you'll see the .c files.


      All code is usually tested, but rarely trusted.
      that is exactly what I was seeking. Indeed, it's not there in all cases, but very useful to know about.
Re: cpan modules - pm only?
by rjbs (Pilgrim) on Sep 02, 2005 at 12:42 UTC

    A slight improvement on browsing would be to look at just the manifest file. You can see an HTMLified version of it here (using CGI-Application as an example): MANIFEST. You can see the source, if you know the version, as here: MANIFEST source. You could, of course, use WWW::Mechanize to go from one to the other.

    If you run your own CPAN mirror, or use minicpan, you can write a simple script to check manifests for you, too.

Re: cpan modules - pm only?
by rinceWind (Monsignor) on Sep 02, 2005 at 14:26 UTC

    Some time ago I posted the thread The quest for pure perl. The issues I had were with binary XS code. The issue I had with my C compiler I have since solved.

    Is your problem with compilation? What platform are you using?


    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)

Re: cpan modules - pm only?
by rvosa (Curate) on Sep 02, 2005 at 09:41 UTC
    You mean from within the cpan cli utility?
      whatever .. but what is pointed out below is more like it. At work it's a bit tricky to get things installed that require compilation, and some things aren't worth that much hassle. It's good to see on CPAN itself.
Re: cpan modules - pm only?
by mattr (Curate) on Sep 03, 2005 at 15:38 UTC
    The surfable MANIFEST, and some modules have "-PP" (pure perl) added to their names.

    Also, you can try
    tar -tzf file.tar.gz| perl -nle 'print if /\.c$/'

      First, why would you use perl when grep does just fine? grep '\.[cC]$' is way more succinct. Unix is not just an environment for running perl, you know!

      Second, as just a minor nit, you're missing the v option for tar - without which, your tar command will print out, well, nothing. tar tvzf file.tar.gz | ...

        On my RedHat 9 linux system, tar tzf provides output without needing the v.

        Also grep is a bit different on different systems, and I believe regexes need to be grep -e or use egrep. Anyway I like perl, it works better for me..