in reply to Re: Howto Call Package from a Subdirectory
in thread Howto Call Package from a Subdirectory
unfortunately FindBin is not very reliable, especially in a persistent web environment (mod_perl). this has been discussed before:
the correct method, learned from the monks, that i currently use without problems in shell/web programs:
use vars qw( $RealBin ); BEGIN { use File::Spec::Functions qw( rel2abs splitpath catpath); $RealBin = catpath ((splitpath (rel2abs ($0)))[0,1]); } use lib "$RealBin/modules_src/"; # relative path from your Perl progr +am
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Howto Call Package from a Subdirectory
by bart (Canon) on May 07, 2007 at 12:32 UTC | |
by arpad.szasz (Pilgrim) on Jun 18, 2011 at 23:17 UTC |