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 :
export PERLBREW_ROOT=/home/userx/perl5/perlbrew
source $PERLBREW_ROOT/etc/bashrc
also :
root# perlbrew list
* perl-5.17.8
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 :
/home/userx/perl5/perlbrew/perls/perl-5.17.8/lib/5.17.8/x86_64-linux/Time
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..
thanks

PS> And of course I have this in the bash script :
export PERLBREW_ROOT=/home/userx/perl5/perlbrew
export PERLBREW_HOME=~/.perlbrew
source ${PERLBREW_ROOT}/etc/bashrc

In reply to shared perlbrew running as root by rootcho

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.