Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Module not included but present in %INC!

by toolic (Bishop)
on Jan 06, 2012 at 15:04 UTC ( #946610=note: print w/replies, xml ) Need Help??

in reply to Module not included but present in %INC!

Add this to your "class file" (whatever that means):
print $INC{"Date/"}; use Data::Dumper; print Dumper(\@INC);
Also, copy-and-past the exact error message you are getting in your OP.

Can you reduce your class file to the minimum number of lines which still reproduce your problem?

Update: another possibility... does your class file have a different shebang line from your script (#!/usr/bin/perl)?

Replies are listed 'Best First'.
Re^2: Module not included but present in %INC!
by Anonymous Monk on Jan 06, 2012 at 16:10 UTC

    Hello toolic,

    Thank you for your reply. My bad, I meant perl module when I said class file. Sorry about that.

    This is the output after I added your lines to the file:
    /usr/lib/perl5/site_perl/5.8.8/Date/$VAR1 = [ '/usr/local/nagios/libexec', '/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi' +, '/usr/lib64/perl5/site_perl/5.8.7/x86_64-linux-thread-multi' +, '/usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi' +, '/usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi' +, '/usr/lib/perl5/site_perl/5.8.8', '/usr/lib/perl5/site_perl/5.8.7', '/usr/lib/perl5/site_perl/5.8.6', '/usr/lib/perl5/site_perl/5.8.5', '/usr/lib/perl5/site_perl', '/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-mult +i', '/usr/lib64/perl5/vendor_perl/5.8.7/x86_64-linux-thread-mult +i', '/usr/lib64/perl5/vendor_perl/5.8.6/x86_64-linux-thread-mult +i', '/usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-mult +i', '/usr/lib/perl5/vendor_perl/5.8.8', '/usr/lib/perl5/vendor_perl/5.8.7', '/usr/lib/perl5/vendor_perl/5.8.6', '/usr/lib/perl5/vendor_perl/5.8.5', '/usr/lib/perl5/vendor_perl', '/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi', '/usr/lib/perl5/5.8.8', '.' ];

    The error message I get is:
    Undefined subroutine &Dante::Correlation::CorrelationEngine::str2time +called at /usr/local/nagios/libexec/Dante/Correlation/CorrelationEngi line 644.

    The only way to reduce the pm into minimum number of lines would be which I had written. Only difference is that I have another .pl script which includes
    Thanks for your help.
      Undefined subroutine &Dante::Correlation::CorrelationEngine::str2time +called at /usr/local/nagios/libexec/Dante/Correlation/CorrelationEngi line 644

      This means that the offending code lives in /usr/local/nagios/libexec/Dante/Correlation/, and my guess is that the file in question does not load Date::Parse.

        Thanks for your reply Corion
        I reduced my pm file and wrote another .pl so as to reproduce the problem. Here they are: The file, which includes the .pm file:
        #!/usr/bin/perl use strict; use warnings; use Dante::Correlation::CorrelationEngine; my $correlationEngine = Dante::Correlation::CorrelationEngine->new(1); $correlationEngine->testFunction(); exit;
        The file:
        # # - Implements top-level co +rrelation logic. # ########## use strict; use warnings; use Date::Parse; # There are a bunch of other .pm includes here, but they are modules f +or the project, not any other perl module # There are other functions here, not listed, of course sub testFunction { print str2time("2011-03-18 02:39:04") . "\n"; print str2time("1970-01-01 00:00:10") . "\n"; print str2time("2012-01-05 14:23:09") . "\n"; } # Must return 1 for the class to be compilable. 1; # End of
        Executing results in following error:
        ./ Undefined subroutine &Dante::Correlation::CorrelationEngine::str2time +called at Dante/Correlation/ line 664.

        So if the culprit is, how can I make sure it loads Date::Parse?
        I'm at my wits end with this now; seems so simple, can't figure out why its not working.
        Please help!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://946610]
[usemodperl]: just because of banking apps on free wifi, and porn, i guess...
usemodperl thinks every1 should serve HTTP on port 80 incase we don't care about encryption, right? wtf

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2018-06-24 09:31 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.