Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Trouble finding modules from cron

by faineant (Beadle)
on Apr 12, 2017 at 19:11 UTC ( #1187800=note: print w/replies, xml ) Need Help??


in reply to Re: Trouble finding modules from cron
in thread Trouble finding modules from cron

I've tried your suggestion and the one provided by cbeckley.

Both work, but are there reasons for choosing one approach over the other?

Thanks -F

  • Comment on Re^2: Trouble finding modules from cron

Replies are listed 'Best First'.
Re^3: Trouble finding modules from cron
by huck (Prior) on Apr 12, 2017 at 19:22 UTC

    In the "-I" approach the biggest consideration comes from module movement. If the modules move from /some/location to /another/location only one place (/usr/bin/perlcron) needs to change and all the programs using those modules are repaired. When using findbin/lib each program itself has to be repaired. At one site i was at we moved boxes 4 times in about 7 years, each move with changes to the names of the file system paths. In that case it wasnt for cron, but to ensure a working production environment. As soon as i fixed the initiator-script all the processes worked under the new locations. I also use this method still on my home boxes, various windoz and linuxen, each with its own customized initiator script to let it run in that environment.

      I would only add that if the scripts and the modules are going to maintain their relative positions in the file system before and after a move, then no change is required with

      use lib "$FindBin::Bin/../path/to/modules";

      However if there's a risk that the modules might move in relation to the scripts, then huck's solution is certainly more flexible.

      Thanks,
      cbeckley

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2023-12-11 12:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (41 votes). Check out past polls.

    Notices?