Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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

by Russ (Deacon)
on Sep 07, 2001 at 21:01 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-03-29 08:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found