I'm running Perl 5.8 on AIX 5.2. I'm trying to modularize a program for maintenance sake, and having no luck. I'd also like to be able to pull in just the functions I need at runtime with require, but I'm willing to do without that.

I pulled out several sets of functions and placed each set in a separate .pl file, and then ran pl2pm on each file. I put them in a subdirectory of the current directory called focus, and added "use lib ./focus" to the front of the main program. However, when I run the program, I still get output such as the following:

Can't locate base in @INC(@INC contains: ./focus /usr/opt/perl5/lib/5.8.0/aix-thread-multi /usr/opt/perl5/lib/5.8.0 /usr/opt/perl5/lib/site_perl/5.8.0/aix-thread-multi /usr/opt/perl5/lib/site_perl/5.8.0 /usr/opt/perl5/lib/site_perl .) at sl_observe.pl line 216.

I've tried using the modules in the same directory, in the subdirectory, with different names, etc. Following is the block of code containing my require statement:

foreach $focus_area (@focus_areas_list) {
	if ($areas =~ /$focus_area/) {
		chop $focus_area;
		push @focus_areas, $focus_area;
		require "$focus_area";
	}
}

In reply to can't find my module? by arootbeer

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.