Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: @INC from $0

by Anonymous Monk
on Jul 24, 2015 at 01:48 UTC ( [id://1136102]=note: print w/replies, xml ) Need Help??


in reply to Re: @INC from $0
in thread @INC from $0

use happens at BEGIN time, so that won't work  Empty compile time value given to use lib

Replies are listed 'Best First'.
Re^3: @INC from $0
by BrowserUk (Patriarch) on Jul 24, 2015 at 01:51 UTC

      Then wrap it in a BEGIN block.

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

        Is matter of order?..(UPDATE: evidently not seen the anonym's answer above..)
        BEGIN{($path = $0) =~ s[[\\/][^\\/]+$][];} BEGIN{ use lib $path;}

        gives no error.

        L*
        There are no rules, there are no thumbs..
        Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
        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://1136102]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-25 23:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found