To find out where cpan has installed GD, use the "m" command and look for the "INST_FILE" item. This is the path where the module is installed. On my system, it looks as follows:

cpan[8]> m GD Module id = GD DESCRIPTION Interface to Gd Graphics Library CPAN_USERID LDS (Lincoln D. Stein <lstein@cshl.edu>) CPAN_VERSION 2.41 CPAN_FILE L/LD/LDS/GD-2.41.tar.gz UPLOAD_DATE 2008-08-07 DSLIP_STATUS MdcOp (mature,developer,C,object-oriented,Standard-Pe +rl) MANPAGE GD.pm - Interface to Gd Graphics Library INST_FILE /usr/local/lib/perl5/site_perl/5.10.0/i686-linux/GD.p +m INST_VERSION 2.41

As cpan sees that the module is installed but your script can't load it, it must be that cpan and your script are looking in different places. Your script will look in every folder listed in @INC, the contents of which are displayed in the error message you have posted.

This can happen if you have two different instances of perl on your system. You may run one when you run cpan (which is a perl script) and a different one when you run your script producing the error.


In reply to Re: Can't locate GD.pm in @INC by ig
in thread Can't locate GD.pm in @INC by mowax

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.