Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Monk::Thomas's scratchpad

by Monk::Thomas (Friar)
on Aug 24, 2012 at 08:19 UTC ( [id://989452]=scratchpad: print w/replies, xml ) Need Help??

just for me to remember
# add custom libraries location to @INC my $lib_location; BEGIN { # only included during BEGIN use Cwd qw(realpath); use File::Spec::Functions 3.33 qw(splitpath catdir rel2abs); # rebase into absolute location if necessary; split into file comp +onents my ($vol_t, $prog_dir_t, $file_t) = splitpath( rel2abs($PROGRAM_NA +ME) ); my $lib_dir_t = catdir($prog_dir_t, '..', 'lib', 'perl5'); my $lib_loc_t = realpath(File::Spec->catpath($vol_t, $lib_dir_t, q +{})); # force an untaint for $lib_loc_t - accept anything that has been +provided # (or else we would have to create a regexp which would verify the + correct # filename for UNIX, Windows, VMS, OS/2, ... - make sure this scr +ipt is # in a sane location and cross fingers) $lib_location = ($lib_loc_t =~ /(.*)/xms)[0]; print "lib location: $lib_location\n"; } use lib $lib_location;
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found