I have perlbrew installed in one of my user accounts and what to be able to use it from root.
I configured root ./.bashrc to have :
root# perlbrew list
So far so good I can run perl scripts from bash-console as root
The problem is if I try to run perl script inside a bash script, I get complains about modules not found :
Can't locate Time/HiRes.pm in @INC (@INC contains: /home/userx/perl5/perlbrew/perls/perl-5.17.8/bin/../lib /usr/local/lib64/perl5 ...
And yes if I try to do :
root# perldoc Time::HiRes
Can't find any loadable formatter class in Pod::Perldoc::Toman Pod::Perldoc::Toman ...
But if I check in my userx account I can see the package here :
And of course doing perldoc Time::HiRes from usex account works.
userx$ cpanm Time::HiRes
Time::HiRes is up to date. (1.9725)
What could be the problem... it seems like PERLLIB problem ?
and how to solve it..
PS> And of course I have this in the bash script :