in reply to Conditional 'use lib'
The work is done inside of lib.pm's import method, so you might try:
BEGIN { use Sys::Hostname; require lib; if (hostname() eq 'foo.bar.org') { lib->import('/alternate/libdir'); } else { lib->import('/default/libdir'); } }
The advantage of this over the unshift trick is that you'll get architecture-dependent paths added, as well.
perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Conditional 'use lib'
by Anonymous Monk on Dec 04, 2007 at 18:48 UTC |