Try this:

use lib '/home/neteng'; # use RRDs; # do this, or the eval statement (to check success/fail) eval "require RRDs"; if( $@ ){ print "RRDs is not installed\n"; }

See also use and perlfaq8 (What's the difference between require and use? How do I keep my own module/library directory? How do I add the directory my program lives in to the module/library search path? How do I add a directory to my include path at runtime? ).

HTH

Update: For what it's worth, the module couldn't be found because (as you point out) it wasn't in @INC. First add the directory for the module to @INC with use lib, then use or require it (don't include the '.pm' when using or requiring a module, and don't include the module name in a use lib statement). Oh, and use warnings; use strict;.


In reply to Re: module problems by bobf
in thread module problems by zajaco0

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.