mosh has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, I received perl script, and when trying to run it, I get:
Can't locate utils.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i38 +6-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5. +8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/p +erl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-mul +ti /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl) at ./ +check_cit_nat.pl line 59. BEGIN failed--compilation aborted at ./check_cit_nat.pl line 59.
Line 59 is:
use utils qw(%ERRORS &print_revision &support &usage);
I search for utils in cpan and there's a lot ! Do anyone can assist me, and tell me what module to download, base on the upper line 59 ? Thanks in advance, mosh.

Janitored by Arunbear - added code tags, and retitled from 'utils.pm module'

Replies are listed 'Best First'.
Re: Can't locate utils.pm in @INC
by gellyfish (Monsignor) on Oct 13, 2004 at 15:59 UTC

    I would guess that the utils.pm that you are looking for is not on CPAN and should in fact be with the program that you are trying to run (probably in the same directory). There is no module called 'utils' on CPAN (and quite frankly if someone was to upload one they would probably be hunted down and killed.) If you got the program from someone else you should ask them for it, if you copied the program from another machine then you should look in the directory where you found it for 'utils.pm'

    /J\

      And as an explanation why they'd be hunted down, module names beginning with lower cased letters are reserved by convention for perl compiler pragmas (e.g. lib, warnings); user modules should always be capitalized. See perldoc perlmod for more details.

Re: Can't locate utils.pm in @INC
by ikegami (Patriarch) on Oct 13, 2004 at 16:55 UTC
    It sounds like a module that should have come with the script and should be in the same directory as the script, like the others mentioned. But since "." isn't in your @INC, perl won't find the module even if you do have it. Adding use lib '.' or use lib '/path/to' to the top of check_cit_nat.pl should help. Alternativel, PERL5LIB env var can also be used to specify where to look for modules.
Re: Can't locate utils.pm in @INC
by ysth (Canon) on Oct 13, 2004 at 16:54 UTC