Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Don't panic, you should be able to get it :)

Here is the quick and dirty "how to install CPAN modules" :

  1. if your OS is windows and you're running ActiveState Perl, go to step 6.
  2. if your OS is linux, first check there isn't a package for your distribution with the appropriate module. For instance, it's part of the basic Debian "perl" package.
  3. if your OS is Linux/FreeBSD/MacOS X/Solaris/(put here your favorite Unix flavour) type the "cpan" command from a root shell.
  4. Follow the on screen instructions for configuration. Choose a mirror close to you.
  5. When setup is completed, type the command (at the "cpan>" prompt): inst GDBM_File It should install the module in some appropriate place.
  6. For ActiveState Perl, use the "ppm" command instead of "cpan". Proceed to step 4.

If you'd rather use a downloaded file and configure everything by hand:

  1. download the package from CPAN (should be a tar.gz file)
  2. unpack it (tar xzf module.tar.gz)
  3. enter the module directory created and follow the instructions from the INSTALL file.
  4. should be something such as  perl Makefile.PL ; make ; make test ; make install

When done, get sure the installed module is in the search path for perl ( @INC variable). For instance you currently have your in  /usr/src/contrib/perl5/ext/GDBM_File/ folder, which is NOT in the @INC :

Can't locate in @INC (@INC contains: /usr/local/lib/perl5/site_perl/5.8.6/mach /usr/local/lib/perl5/site_perl/5.8.6 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.8.6/BSDPAN /usr/local/lib/perl5/5.8.6/mach /usr/local/lib/perl5/5.8.6 .)

If for some reason you'd like to keep the module in some unusual place (for instance because you modified it), then you should add the directory where your module is to the @INC in each script using it. Add this at the beginning of your script (before the "use somemodule" statement):

use lib '/path/to/some/directory/';

see a more detailed explanation at if necessary.

Update: Apparently you're running FreeBSD, don't you? For some reason the module appears under /usr/src, maybe that means it still need to be compiled before use. Go the the directory, see if there's a "Makefile.PL" file lying there. If it's there, you'll probably need to compile/install the module before use (see above). If there isn't any Makefile, then the module is probably usable "as is", just add the directory to @INC in your script.

In reply to Re: Installing Module from source.... by wazoox
in thread Installing Module from source.... by stevenrh

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2023-03-25 10:04 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (63 votes). Check out past polls.