Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Monk::Thomas's scratchpad

by Monk::Thomas (Beadle)
on Aug 24, 2012 at 08:19 UTC ( #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
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (11)
As of 2014-08-27 22:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (253 votes), past polls