Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: problem with INC

by broquaint (Abbot)
on Jan 21, 2004 at 16:18 UTC ( [id://322930]=note: print w/replies, xml ) Need Help??


in reply to problem with INC

Because use is evaluated at compile-time you need to modify @INC before a given use statement is reached. Handily perl comes with the lib module to facilitate such @INC munging e.g
## this will modify @INC before the next 'use' statement use lib "/home/user/scripts"; use kp1;
Also note that I didn't use the lexical variable $dir as that will be declared at compile-time but won't be initialized until run-time (although you can get around this by using a BEGIN block).
HTH

_________
broquaint

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-26 06:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found