Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

To "use" expected version of .pm file

by Rijwan (Novice)
on Nov 27, 2008 at 09:48 UTC ( [id://726357]=perlquestion: print w/replies, xml ) Need Help??

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

There are 2 versions of perl installed on my machines. How to make sure perl script uses correct/expected .pm file at run time. Generally Perl gets installed with Oracle & same is case with my product.now when we execute perl file it gives error about .pm file Perl lib version (v5.8.3) doesn't match executable version (v5.8.0) at D:\oracle \10.2.0\perl\5.8.3\lib\MSWin32-x86-multi-thread/Config.pm line 32. Compilation failed in require at D:\oracle\10.2.0\perl\5.8.3\lib\MSWin32-x86-mul ti-thread/Errno.pm line 8. I have used strict.pm & other .pm files in the code how to avoid this situation?

Replies are listed 'Best First'.
Re: To "use" expected version of .pm file
by Taulmarill (Deacon) on Nov 27, 2008 at 10:23 UTC
    perl holds the paths to it's modules in the array @INC. A common way to manipulate that array is to add paths using use lib '/path/to/module'.
    Also you might want to check the environment variable PERL5LIB.
      i have written following line - use lib "lib path"; but it gives error "unable to find lib.pm" There is no lib.pm file as such. few lines of code are - use strict; use Getopt::Std;
        try
        perldoc -q path
        Sounds like you have a broken install, as lib.pm is standard since version 5.001. What does perl -V report?

        lib is part of Perl, so that's very odd. But you don't have to use lib to modify @INC.

        BEGIN { unshift @INC, '/home/user/perllib'; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-25 13:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found