in reply to Installing DBI module

DBI is a module that relies on XS, meaning the bulk of it is written in C, the Perl part is mostly only a connection layer between Perl and the module. As a consequence, "placing it in the right place" can't work: the module must be built first, which involves a C compiler. You can use a module like CPAN to (optionally) download and install a module, or you can download it by hand, extract the .tar.gz file, and at the command prompt, cd to the main directory that got extracted, and type the following commands, one at a time:
perl Makefile.PL make make test make install
Do not proceed to the next command if the output of the last command doesn't look right. For example, do not type "make install" if "make test" complains.

Why am I even typing that here? The DBI docs even mention this, at the very top, under "quick start"

It is possible to "just place the files at the appropriate place" if you do have prebuilt binary files for your platform. For example, that's what Activestate provides for this kind of modules for Windows (all versions), for example: the XS parts come built as DLL files.

Replies are listed 'Best First'.
Re: Installing DBI module
by FireBird34 (Pilgrim) on Jan 19, 2003 at 21:00 UTC
    I found that install stuff inside the doc's aswell -- just ran into a different stumbling block (suprise suprise lol). I'm over at Mandrake Expert right now trying to resolve that (it's dealing with the compilers). I'll post back here if I have anymore problems with this on the module side -- thanks.
      Ah, OK. It looked to me as if you hadn't even bothered to check out how one is supposed to install a module. With the info in the README for the module you're trying to install, that doesn't look good at all.

      Just some extra info on what that sequence of commands does: perl uses a utility called make to build and install the modules. For this it depends on a list of instructions in a file called "Makefile", in the current directory. On the plus side, make checks out dependencies: if a file "b" depends on a file "a", and the modification date of "a" is more recent than that of "b", then make will rebuild "b". On the minus side, make has a user-unfriendly syntax, for example, it makes a huge distinction between tabs and spaces, while both are invisible characters.

      So Perl uses a somewhat more user-friendly, and more platform independent, way, and a script "Makefile.PL", which comes with the module, is used to construct the "Makefile". That's what "perl Makefile.PL" does.

      Next, "make" builds the files. That may involve building loadable libraries using a C compiler. After this step, the final files all do exist.

      The next step, "make test", manipulates @INC so the test scripts, which reside in the "t" subdirectory, and which all carry the file extension ".t", can be run. These test scripts test all sorts of things that are essential for minimal working of the module, and stuff that is known to have gotten broken in the past.

      And finally, if all went well thus far, "make install" will copy the built files in their appropriate final place of the modules file tree.

        Ah, ok. Was first introduced to "make" and "makefile" just a short while ago, and didn't know what they were, or did for that matter... I'm up to the point where the C compiler is being used -- the "cc" command can't be found, so I'm trying to resolve that issue right now.

        The server is actually hosted under a WinXP machine -- I'm just trying to set it up under my linux box aswell to test it out, so I should have it either way -- just really annoying that I can't setup a simple module over a simple problem such as this =(

        Thanks for the info aswell -- still alot to learn, so every little bit helps =)