Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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
Replies are listed 'Best First'.
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 making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2015-07-28 10:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (254 votes), past polls