Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Monk::Thomas's scratchpad

by Monk::Thomas (Scribe)
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 examining the Monastery: (6)
As of 2015-07-04 10:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (59 votes), past polls