Do you know where your variables are? | |
PerlMonks |
Re: Containing 'use lib' statements in modules to their own namespaceby shmem (Chancellor) |
on Oct 19, 2015 at 11:26 UTC ( [id://1145315]=note: print w/replies, xml ) | Need Help?? |
You can place a copy of your perl's lib.pm into the directory where your debug versions of modules live. Then edit that lib.pm to remember the first path actually passed to use lib:
See the lines marked with # EDIT. Make sure your directory is the first which gets into the private $sticky_dir variable. All subsequent calls to use lib will result in the directories being placed after the sticky directory:
update: Instead of the first BEGIN block, invoking a script like this
prepends /my/debug/directory to @INC to have /my/debug/directory/lib.pm loaded at the first call to use lib inside the script - so you can switch on debugging without modifying the script at all.
perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
In Section
Seekers of Perl Wisdom
|
|