Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: How to use a .pm file in a .pl file in another directory.

by kielstirling (Scribe)
on Jan 30, 2012 at 05:31 UTC ( #950700=note: print w/ replies, xml ) Need Help??


in reply to How to use a .pm file in a .pl file in another directory.

Hi,

For a local library directory I use the following. It relies on a lib directory existing within your project. i.e. /your/project/lib

use FindBin qw($Bin); use lib "$Bin/lib";

You can then create your modules within this directory. i.e. /your/project/lib/Foo/Blah.pm Then in your code use it like

use FindBin qw($Bin); use lib "$Bin/lib"; use Foo::Blah

Have fun !!

-Kiel R Stirling


Comment on Re: How to use a .pm file in a .pl file in another directory.
Select or Download Code
Re^2: How to use a .pm file in a .pl file in another directory.
by tommyxd (Acolyte) on Jan 30, 2012 at 19:31 UTC

    I'll give that a shot as well, thanks, Kiel! :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://950700]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2014-11-26 09:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (165 votes), past polls