Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Monk::Thomas's scratchpad

by Monk::Thomas (Friar)
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?

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2019-02-17 09:51 GMT
Find Nodes?
    Voting Booth?
    I use postfix dereferencing ...

    Results (96 votes). Check out past polls.