Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: @INC error

by worstead (Acolyte)
on Jan 17, 2020 at 18:51 UTC ( #11111542=note: print w/replies, xml ) Need Help??


in reply to Re: @INC error
in thread @INC error

Tried that. "/usr/local/share/perl5/Mail" there but still get same error.
melisa:~/CRON$ ./print-INC.pl /home/jrayner/perl5/lib/perl5/x86_64-linux-thread-multi /home/jrayner/perl5/lib/perl5 /home/jrayner/perl5/lib/perl5/x86_64-linux-thread-multi /home/jrayner/perl5/lib/perl5 /home/jrayner/perl5/lib/perl5/x86_64-linux-thread-multi /home/jrayner/perl5/lib/perl5 /usr/local/share/perl5/Mail /usr/local/lib64/perl5/5.30 /usr/local/share/perl5/5.30 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5
error
Can't locate Mail/Mailer.pm in @INC (you may need to install the Mail: +:Mailer module) (@INC contains: /usr/local/lib64/perl5/5.30 /usr/loca +l/share/perl5/5.30 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vend +or_perl /usr/lib64/perl5 /usr/share/perl5) at /home/jrayner/CRON/emai +l-reminder-2.0.pl line 62. BEGIN failed--compilation aborted at /home/jrayner/CRON/email-reminder +-2.0.pl line 62.
The program "email-reminder-2.0.pl" appears to run correctly when called independently but not when called by cron.

Replies are listed 'Best First'.
Re^3: @INC error
by haukex (Chancellor) on Jan 18, 2020 at 09:40 UTC
    Tried that.

    I think it'd be best if you showed us exactly what you tried, because the output you're showing here just shows that some of the entries in @INC got duplicated, not that the path /usr/local/share/perl5 got added to @INC like we suggested. And as I said, in cron, you'll have to set up the environment variables yourself. If you could explain more about your setup (like whether you're actually using local::lib or not, and how the module ended up where it did, what commands you're actually trying, etc.), we could be of more help.

Re^3: @INC error
by syphilis (Bishop) on Jan 17, 2020 at 23:56 UTC
    The program "email-reminder-2.0.pl" appears to run correctly when called independently but not when called by cron.

    It therefore seems that a different @INC is being used when cron runs the script.
    The error message plainly states that @INC is:
    /usr/local/lib64/perl5/5.30 /usr/local/share/perl5/5.30 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5
    If /usr/local/share/perl5/Mail/Mailer.pm exists, then @INC needs to include /usr/local/share/perl5.
    But /usr/local/share/perl5 is not one of the locations specified in @INC when cron runs the script.

    Cheers,
    Rob
Re^3: @INC error
by ikegami (Pope) on Jan 20, 2020 at 15:39 UTC

    huh, /usr/local/share/perl5 is still not in @INC. (No idea what the first list you posted is, but it's not in that either.)

Re^3: @INC error
by Anonymous Monk on Jan 18, 2020 at 02:57 UTC

    Tried that. "/usr/local/share/perl5/Mail" there but still get same error.

    It doesn't look like it


    melisa:~/CRON$ ./print-INC.pl
    /home/jrayner/perl5/lib/perl5/x86_64-linux-thread-multi
    /home/jrayner/perl5/lib/perl5
    /home/jrayner/perl5/lib/perl5/x86_64-linux-thread-multi
    /home/jrayner/perl5/lib/perl5
    /home/jrayner/perl5/lib/perl5/x86_64-linux-thread-multi
    /home/jrayner/perl5/lib/perl5
    /usr/local/share/perl5/Mail
    /usr/local/lib64/perl5/5.30
    /usr/local/share/perl5/5.30
    /usr/lib64/perl5/vendor_perl
    /usr/share/perl5/vendor_perl
    /usr/lib64/perl5
    /usr/share/perl5

    ##</code><code>##

    Can't locate Mail/Mailer.pm in @INC (you may need to install the Mail::Mailer module) (@INC contains: /usr/local/lib64/perl5/5.30 /usr/local/share/perl5/5.30 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at /home/jrayner/CRON/email-reminder-2.0.pl line 62.
    BEGIN failed--compilation aborted at /home/jrayner/CRON/email-reminder-2.0.pl line 62.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11111542]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2020-02-28 21:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (127 votes). Check out past polls.

    Notices?