in reply to How to Add path to @INC
This adds directories to @INC at compile-time, so they're valid in subsequent use statements. Try perldoc lib for more information on this.use lib qw(/my/path/to/add/);
The longer answer:
You could do this to add things to @INC:
because, @INC is just a Perl array, nothing special. However, use statements are executed at compile time, not at runtime, so if you simply push onto the array, @INC won't be changed until runtime, and your use still won't find what it's looking for.push @INC, '/my/path/to/add';
Pushing things directly onto @INC would work if you're just doing require, which happens at runtime. But the short answer is best: just use lib and you'll be happy.
Alan
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: How to Add path to @INC
by Fastolfe (Vicar) on Jul 28, 2000 at 22:30 UTC |