Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^7: Perl app won't compile /run from cron

by huck (Prior)
on May 27, 2018 at 04:16 UTC ( [id://1215263]=note: print w/replies, xml ) Need Help??


in reply to Re^6: Perl app won't compile /run from cron
in thread Perl app won't compile /run from cron

The root cause is you are not using cron correctly

see https://stackoverflow.com/questions/32726324/i-installed-a-module-successfully-with-cpan-but-perl-cant-find-it-why.

If you choose to bootstrap local::lib (the default), the module will be installed inside ~/perl5. You may also be prompted something like: Would you like me to append that to /home/foo/.bashrc now? [yes] If you choose yes (the default), some variables will be added to your .bashrc (or the equivalent for your shell) so that when you run CPAN in the future, modules will continue to be installed in your home directory:

so you have PERL5LIB updates stored in .bashrc (or the equivalent for your shell), but cron BY DESIGN does not run anything in that file. it is up to you to include anything from that file that you need in your cron request. Again see The Cron Environment and Cron Job Failures

It was not "designed to fail by default", cpan did what it was designed to do, and cron did what it was designed to do, but instead you failed to use cron correctly.

Replies are listed 'Best First'.
Re^8: Perl app won't compile /run from cron
by dazz (Beadle) on May 27, 2018 at 09:12 UTC
    Hi OK I have not used cpan correctly.
    I have never heard of local::lib or @INC until this thread.
    I did find cpan variables in my .bashrc file and removed them.
    I did run  cpan > o conf init.
    There was no option asked that mentioned "bootstrap".
    On completion of the command .bashrc remained clear of any perl stuff.

    If it isn't a bug it is a bad design. It shouldn't be so difficult to do something so simple.

    Dazz
      I have never heard of local::lib or @INC until this thread.

      @INC is mentioned in the FAQ, perlrun, the documentation for lib and, of course perlvar. I'm slightly surprised that you've read none of these yet.

      It shouldn't be so difficult to do something so simple.

      Where's the difficulty? Just set up your environment properly as outlined in Re: Perl app won't compile /run from cron and you're there.

      It's neither a bug nor bad design. You're using tools without understanding how they work, and then declaring bugs where none exist when things don't work as you imagine they should.

      Your configuration of the CPAN client and setup does not live in your .bashrc file but likely in ~/.cpan/CPAN/MyConfig.pm. If you erase that, CPAN will likely ask you again, which install method you prefer for modules.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-04-19 11:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found