There's more than one way to do things | |
PerlMonks |
Installing CPAN Modules within BEGIN of PERL Scriptby GhostCode (Initiate) |
on Aug 18, 2021 at 19:47 UTC ( [id://11135942]=perlquestion: print w/replies, xml ) | Need Help?? |
GhostCode has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks, I am working to develop a software distribution that will be run by several users in my environment. In order this this application to function correctly, I must have the ability to dynamically install CPAN modules when found not to be present within the current PERL installation. I have the logic down; however, I am still having issues... Logic: Part two is where I am having problems. I have tried both the command line for cpan (cpan -I <module>) as well as the install function of CPAN::Shell (CPAN::Shell->install(<module>)). Unfortunately every time I run this script it tells me the latest version of the specific module is already installed; however, it most certainly is not. Take the example of Bone::Easy. When I run: CPAN::Shell->install("Bone::Easy"); or `cpan -I Bone::Easy`; I get the message that I already have the latest version. If I then, go on to attempt to use this module (using: require Bone::Easy;), I am met with this module not being installed. Can anyone help me to better understand what may be going on here. I am certain I am missing something and would really appreciate the help. Here is a copy of the script I am using to test this procedure... Best, Bry
Back to
Seekers of Perl Wisdom
|
|