Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Where the perl scripts live (Russ - 'use lib' hack)

by Russ (Deacon)
on Sep 07, 2001 at 21:01 UTC ( #110943=note: print w/replies, xml ) Need Help??


in reply to Where the perl scripts live...

Noting that I do not necessarily recommend this procedure, yet use it on occasion (in an environment where I implicitly trust the user - me):
# Ugly trick to let us use our modules while calling the script from e +lsewhere use lib substr($0, 0, rindex($0, '/'));
I now have access to the script's directory and can use modules located there, even though I was in another directory when I executed the script.

$Pretty--
$Effective++

Russ
Brainbench 'Most Valuable Professional' for Perl

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://110943]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2022-05-18 13:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (70 votes). Check out past polls.

    Notices?