Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: @INC from $0

by BrowserUk (Patriarch)
on Jul 24, 2015 at 01:14 UTC ( [id://1136098]=note: print w/replies, xml ) Need Help??


in reply to @INC from $0

some other elegant solution I've overlooked?

lib is core:

($_ = $0) =~ s[[\\/][^\\/]+$][]; use lib $_;

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.
I'm with torvalds on this Agile (and TDD) debunked I told'em LLVM was the way to go. But did they listen!

Replies are listed 'Best First'.
Re^2: @INC from $0
by Anonymous Monk on Jul 24, 2015 at 01:48 UTC
    use happens at BEGIN time, so that won't work  Empty compile time value given to use lib

        Then wrap it in a BEGIN block.

        Same issue  BEGIN{($_ = $0) =~ s[[\\/][^\\/]+$][]; use lib $_;}

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-16 05:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found