Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Package name overlap

by manorhce (Beadle)
on Feb 19, 2013 at 14:33 UTC ( #1019579=note: print w/replies, xml ) Need Help??


in reply to Package name overlap

Yes use lib will work and it will load the module from the library which is provided by use lib but better go with include the directory to @INC at the beginning with unshift operator and call that through BEGIN block

For example

use FindBin qw($RealBin); use File::Spec::Functions qw(catdir); BEGIN { my @dirs = splitdir(canonpath($RealBin)); my($path) = grep { -e $_ } ( map { $_ = catdir(@dirs[0 .. $#dirs - + $_]).'pathtoModule' } (0 .. $#dirs) ); unshift(@INC, $RealBin, $path); }

Please let me know if you have anything unclear and you

Replies are listed 'Best First'.
Re^2: Package name overlap
by Anonymous Monk on Feb 19, 2013 at 14:43 UTC
    Why not use?
    use FindBin qw( $RealBin ); use lib "$RealBin/../pathToModule";

    What do you think you're avoiding with your extra code block?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1019579]
help
Chatterbox?
[BarApp]: I can not use modules. I gain temporary access and still can not use modules.
[Cosmic37]: ta erix - this szabo geezer is pretty cool methinks and he writes about undef but I cannot see instructions for redefining the record separator after having undefined it
[Corion]: $/ = "wahtever";
[Corion]: (it's a magic variable)
[karlgoethebier]: BarApp: whoami
[Cosmic37]: ok fankyou - I was wondering about that but thought there might be a redefine command or something; peachy
[Lotus1]: Cosmic37 if you undef $/ in a local context to a block it won't affect the global version after the block finishes
[Lotus1]: or you can just do local $/ in a block

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2017-06-29 16:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (672 votes). Check out past polls.