in reply to Re: Help needed with terminology - different formats of modules
in thread Help needed with terminology - different formats of modules

Yes I've read that tutorial but it doesn't answer any of the questions I have asked in this post. I may have asked other general questions in the past but this is a specific question unrelated to other posts. I hope that's ok

I wanted to have a go at installing a module manually without CPAN for the experience which is why I asked for the format 'raw' modules come in so I could have find a module and install it. I presume they are just the source code but I don't know if it is correct to say (or search for in google) 'I need the source code of the CGI::Session module'

Regardless of whether I use CPAN or apt-get to install a module, I would like to know what formats the modules come in for these 2 different tools. I can't discuss my problems with people if I don't know the right terms. I know apt-get uses .deb files but I don't know if it is correct to say something like 'I need the .deb version of a perl module.' Similarly if I don't know if it is correct to say 'I need the CPAN version of a Perl module.' It would also be nice to have a small insight into the different between the CPAN version and the .deb version of a module. I'm not being lazy in asking in a forum. I've spent the past 2 days tirelessly searching the internet but its like finding a needle in a haystack. Most websites simply tell you what to do without giving any insight into what you are doing and why.

Does that make more sense? I hope so :)

  • Comment on Re^2: Help needed with terminology - different formats of modules

Replies are listed 'Best First'.
Re^3: Help needed with terminology - different formats of modules
by marto (Cardinal) on Oct 28, 2010 at 17:19 UTC

    "Yes I've read that tutorial but it doesn't answer any of the questions I have asked in this post. I may have asked other general questions in the past but this is a specific question unrelated to other posts. I hope that's ok."

    I don't believe you've read this properly then. From A Guide to Installing Modules:

    The Basics of Module Installation

    Most modules are available from CPAN - the Comprehensive Perl Archive Network. They are supplied in what is known as a tarball. A tarball is a gzip compressed tar file. When a module is made the directory structure it lives in is converted to a single file that contains both the files and the directory information. A program called tar performs this function and the resultant file is called a tar file. Tar files have a .tar file extension. This tar file is then compressed using the gzip (GNU Zip) program. Gzipped files have a .gz extension thus a standard module will be called something like:" Some-Module-0.01.tar.gz

    That tutorial then goes on to explain what I've already told you about Modules being pure perl or containing code which needs to be compiled. Which is something you asked about.

    If you want to know what a deb file is, look it up, use Google, read the wikipedia article.

    For clarification, Cpan, the website is essentially dumb storage. The cpan command line utility can be used to fetch,install and upgrade modules, including their dependencies. This is described in the documentation I've linked you to before.

    Think of .deb files as software packages for the Debian (which Ubuntu is based on) operating systems packaging tool (dpkg/apt-get). And the downloads from CPAN as archives for the CPAN tool.

    Once again, if you install a module from a .deb file or via apt-get you are altering the system perl. This install method uses a packaging system for your operating system to make it easy for the OS to be maintained and install other applications. The alternatives have been explained to you several times now, re read your previous posts.

    "I don't know if it is correct to say something like 'I need the .deb version of a perl module.' Similarly if I don't know if it is correct to say 'I need the CPAN version of a Perl module.'"

    Why would you be saying this to anyone? If you wanted to install (a deb file) via apt-get it would fetch it automatically for you from your systems configured software sources. If you want to install your own module from source http://search.cpan.org is the place to go looking. I think you're confusion stems from the following:

    • You're new to linux
    • You don't understand package management
    • You're new to Perl

    These aren't criticisms. I believe these are just the things you need to become acquainted with in order to understand what you want to know at a level you seem to want to understand it.

    "I can't discuss my problems with people if I don't know the right terms."

    If you have a DBI problem, that's what you say to people. "I have a problem with fetching records from Oracle using DBI". IMHO most of the time your problems wont be dependant on how you installed a module.

    Update: Added last sentence.

      I did read that page and it still didn't explain things to me. It might be obvious to someone who knows what they are doing, but when I read that it wasn't clear to me that some modules just contain perl code which can simply be copied to the appropriate location whereas some contain C code which may need to be compiled. When i read it I didn't understand why it started talking about C compilers. I just assumed that was something to do with linux I didn't understand. I got a lot of help from reading this forum post
      http://www.codingforums.com/archive/index.php/t-121250.html
      It's also my fault that I forgot that Perl was interpreted and not compiled because I couldn't work out whether you downloaded source code and compiled byte codes from module repositories. This area of Perl seems to be a bit of a minefield. I was able to read 2 Perl books in a week to get to the stage where I could write object oriented Perl. I'm still fuzzy on the details of this though after 2 days banging my head against the wall :)

        You can start coping pure perl modules to the appropriate places, however this can be a time consuming thing. Say you want to install a fictitious module ACME::Shazam, which you know to be pure perl, you could just copy the files to correct locations, then run some example code which makes use of the module. But, whoops, ACME::Shazam has 10 dependencies, none of which you have two of which are witting in C. It would have been a lot quicker and a much less effort if you used the CPAN client to do this for you.

        "when I read that it wasn't clear to me that some modules just contain perl code which can simply be copied to the appropriate location whereas some contain C code which may need to be compiled."

        The tutorial I linked to has a section "Installing Modules that include elements coded in C". I appreciate that there may be a lot to read/learn at first, but stick with it, explain what's confusing you as clearly as possible and people can help.

        "When i read it I didn't understand why it started talking about C compilers. I just assumed that was something to do with linux I didn't understand"

        This isn't a linux specific thing, Microsoft Platforms have the same issue.