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

How to use the local Devel::Cover module?

by ovedpo15 (Pilgrim)
on May 29, 2021 at 17:14 UTC ( #11133267=perlquestion: print w/replies, xml ) Need Help??

ovedpo15 has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,
I use the Devel::Cover module in the following way:
perl -MDevel::Cover=-silent,1,-db,${cover_db}" <script>
I have cloned locally the Devel::Cover module (since the one installed is a bit old and it will take time for IT to install the new version). How can I tell perl to use to local module?

Replies are listed 'Best First'.
Re: How to use the local Devel::Cover module?
by Perlbotics (Bishop) on May 29, 2021 at 17:32 UTC

    One way is to set PERL5LIB environment variable:

    PERL5LIB=<path-to-your-local-directory> perl -MDevel::Cover=-silent,1 +,-db,${cover_db}" <script>

      Hi,
      Thank you for the reply. I'm familiar with this special env. Did you mean the following? (added a newline):
      PERL5LIB=<path-to-your-local-directory> perl -MDevel::Cover=-silent,1,-db,${cover_db}" <script>
      Also, the Devel::Cover already installed in the lib of the "perl". I think it will still take the one already installed and not the one I cloned.

        No, I meant to have everything in one line. That way, setting of PERL5LIB is valid for this particular invocation of perl only and does not clobber the current value of PERL5LIB (if any) for the rest of your shell session (if exported).

        $: TEST=this #-- your shell might need to 'export' explicitly $: echo $TEST this $: TEST=that eval 'echo $TEST' that $: echo $TEST this

        Setting PERL5LIB the way you did, would keep the setting for the rest of your shell session. You might consider to set it in your shells configuration (.bashrc, .profile, etc.) if required.

        I am not sure, if I understood your last question.

        I think it will still take the one already installed and not the one I cloned.
        No, with path-to-your-local-directory, I meant the .../lib directory of your cloned installation. When in doubt try
        PERL5LIB=<as-needed> perl -MDevel::Cover=-coverage,none -e 'print "$D +evel::Cover::VERSION <--- HERE!\n"'
        and see if the VERSION is as expected (Devel::Cover might print that anyways in its header message).

Re: How to use the local Devel::Cover module?
by Anonymous Monk on May 29, 2021 at 23:15 UTC

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2023-12-02 17:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (18 votes). Check out past polls.

    Notices?