I have failed twice to get this to work. I find some niche module on CPAN, which is just a single .pm file containing perl code. Everything looks good, functions are exported, etc. The two packages are initialized thusly:

use Beep;

and, in another attempt in seperate file:

use Local:TeeOutput;

The common point here is that I don't know how to install these in a nice place, so have been testing them out by putting e.g., Beep.pm in the pwd and TeeOutput.pm in ./Local/ . This was what everything I found online told me would work. It does not. I get the following errors when trying to access functions clearly exported within these files:

Undefined subroutine &main::beep called at ./beep.pl line 5.

Previously I had figured out how to make my perl program find the /Local/ directory I had created, and now that I'm writing this I can't repeat that, so my new problem for that case is that @INC seems to be ignoring it's own contents?

Can't locate TeeOutput.pm in @INC (@INC contains: /(my pwd)/ ./ /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at ./test3.pl line 4. BEGIN failed--compilation aborted at ./test3.pl line 4.

I can post more info, but I have a feeling I'm just doing something very obviously dumb to anyone who knows what's going on.

Thanks for your wonderful site!


In reply to Installing perl-only .pm modules locally?? by emmiesix

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.