Server IP : 180.180.241.3 / Your IP : 216.73.216.252 Web Server : Microsoft-IIS/7.5 System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Program Files (x86)/Git/lib/perl5/5.8.8/ |
Upload File : |
package blib; =head1 NAME blib - Use MakeMaker's uninstalled version of a package =head1 SYNOPSIS perl -Mblib script [args...] perl -Mblib=dir script [args...] =head1 DESCRIPTION Looks for MakeMaker-like I<'blib'> directory structure starting in I<dir> (or current directory) and working back up to five levels of '..'. Intended for use on command line with B<-M> option as a way of testing arbitrary scripts against an uninstalled version of a package. However it is possible to : use blib; or use blib '..'; etc. if you really must. =head1 BUGS Pollutes global name space for development only task. =head1 AUTHOR Nick Ing-Simmons nik@tiuk.ti.com =cut use Cwd; use File::Spec; use vars qw($VERSION $Verbose); $VERSION = '1.03'; $Verbose = 0; sub import { my $package = shift; my $dir = getcwd; if ($^O eq 'VMS') { ($dir = VMS::Filespec::unixify($dir)) =~ s-/\z--; } if (@_) { $dir = shift; $dir =~ s/blib\z//; $dir =~ s,/+\z,,; $dir = File::Spec->curdir unless ($dir); die "$dir is not a directory\n" unless (-d $dir); } my $i = 5; my($blib, $blib_lib, $blib_arch); while ($i--) { $blib = File::Spec->catdir($dir, "blib"); $blib_lib = File::Spec->catdir($blib, "lib"); if ($^O eq 'MacOS') { $blib_arch = File::Spec->catdir($blib_lib, $MacPerl::Architecture); } else { $blib_arch = File::Spec->catdir($blib, "arch"); } if (-d $blib && -d $blib_arch && -d $blib_lib) { unshift(@INC,$blib_arch,$blib_lib); warn "Using $blib\n" if $Verbose; return; } $dir = File::Spec->catdir($dir, File::Spec->updir); } die "Cannot find blib even in $dir\n"; } 1;