#!/usr/bin/perl #line 2 "/usr/bin/par.pl" eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' if 0; # not running under some shell # $File: //member/autrijus/PAR/script/par.pl $ $Author: autrijus $ # $Revision: #97 $ $Change: 9765 $ $DateTime: 2004/01/25 16:09:58 $ vim: expandtab shiftwidth=4 package __par_pl; # --- This script must not use any modules at compile time --- # use strict; #line 155 my ($par_temp, $progname, @tmpfile); END { if ($ENV{PAR_CLEAN}) { unlink @tmpfile; rmdir $par_temp; $par_temp =~ s{[^\\/]*[\\/]?$}{}; rmdir $par_temp; } } BEGIN { Internals::PAR::BOOT() if defined &Internals::PAR::BOOT; eval { if ($ENV{PAR_ARGV_0}) { @ARGV = map $ENV{"PAR_ARGV_$_"}, (1 .. $ENV{PAR_ARGC} - 1); $0 = $ENV{PAR_ARGV_0}; } my $quiet = !$ENV{PAR_DEBUG}; # fix $progname if invoked from PATH my %Config = ( path_sep => ($^O =~ /^MSWin/ ? ';' : ':'), _exe => ($^O =~ /^(?:MSWin|OS2|cygwin)/ ? '.exe' : ''), _delim => ($^O =~ /^MSWin|OS2/ ? '\\' : '/'), ); _par_init_env(); _set_progname(); _set_par_temp(); # Append ".exe" to $0 if it was missing $0 .= $Config{_exe} if $Config{_exe} and $progname =~ /\Q$Config{_exe}\E$/ and $0 !~ /\Q$Config{_exe}\E$/; # Magic string checking and extracting bundled modules {{{ my ($start_pos, $data_pos); { local $SIG{__WARN__} = sub {}; # Check file type, get start of data section {{{ open _FH, $progname or last; binmode(_FH); my $buf; seek _FH, -8, 2; read _FH, $buf, 8; last unless $buf eq "\nPAR.pm\n"; seek _FH, -12, 2; read _FH, $buf, 4; seek _FH, -12 - unpack("N", $buf), 2; read _FH, $buf, 4; $data_pos = (tell _FH) - 4; # }}} # Extracting each file into memory {{{ my %require_list; while ($buf eq "FILE") { read _FH, $buf, 4; read _FH, $buf, unpack("N", $buf); my $fullname = $buf; outs(qq(Unpacking file "$fullname"...)); my $crc = ( $fullname =~ s|^([a-f\d]{8})/|| ) ? $1 : undef; my ($basename, $ext) = ($buf =~ m|(?:.*/)?(.*)(\..*)|); read _FH, $buf, 4; read _FH, $buf, unpack("N", $buf); if (defined($ext) and $ext !~ /\.(?:pm|ix|al)$/i) { my ($out, $filename) = _tempfile($ext, $crc); if ($out) { binmode($out); print $out $buf; close $out; chmod 0755, $filename; } $PAR::Heavy::FullCache{$fullname} = $filename; $PAR::Heavy::FullCache{$filename} = $fullname; } elsif ( $fullname =~ m|^/?shlib/| and defined $ENV{PAR_TEMP} ) { # should be moved to _tempfile() my $filename = "$ENV{PAR_TEMP}/$basename$ext"; outs("SHLIB: $filename\n"); open my $out, '>', $filename or die $!; binmode($out); print $out $buf; close $out; } else { $require_list{$fullname} = $PAR::Heavy::ModuleCache{$fullname} = { buf => $buf, crc => $crc, name => $fullname, }; } read _FH, $buf, 4; } # }}} local @INC = (sub { my ($self, $module) = @_; return if ref $module or !$module; my $filename = delete $require_list{$module} || do { my $key; foreach (keys %require_list) { next unless /\Q$module\E$/; $key = $_; last; } delete $require_list{$key} if defined($key); } or return; $INC{$module} = "/loader/$filename/$module"; if ($ENV{PAR_CLEAN} and defined(&IO::File::new)) { my $fh = IO::File->new_tmpfile or die $!; binmode($fh); print $fh $filename->{buf}; seek($fh, 0, 0); return $fh; } else { my ($out, $name) = _tempfile('.pm', $filename->{crc}); if ($out) { binmode($out); print $out $filename->{buf}; close $out; } open my $fh, $name or die $!; binmode($fh); return $fh; } die "Bootstrapping failed: cannot find $module!\n"; }, @INC); # }}} # Now load all bundled files {{{ # initialize shared object processing require XSLoader; require PAR::Heavy; require Carp::Heavy; require Exporter::Heavy; PAR::Heavy::_init_dynaloader(); # now let's try getting helper modules from within require IO::File; # load rest of the group in while (my $filename = (sort keys %require_list)[0]) { require $filename unless $INC{$filename} or $filename =~ /BSDPAN/; delete $require_list{$filename}; } # }}} last unless $buf eq "PK\003\004"; $start_pos = (tell _FH) - 4; } # }}} # Argument processing {{{ my @par_args; my ($out, $bundle); $quiet = 0 unless $ENV{PAR_DEBUG}; # Don't swallow arguments for compiled executables without --par-options if (!$start_pos or ($ARGV[0] eq '--par-options' && shift)) { my %dist_cmd = qw( p blib_to_par i install_par u uninstall_par s sign_par v verify_par ); while (@ARGV) { $ARGV[0] =~ /^-([AIMOBbqpiusv])(.*)/ or last; if ($1 eq 'I') { unshift @INC, $2; } elsif ($1 eq 'M') { eval "use $2"; } elsif ($1 eq 'A') { unshift @par_args, $2; } elsif ($1 eq 'O') { $out = $2; } elsif ($1 eq 'b') { $bundle = 'site'; } elsif ($1 eq 'B') { $bundle = 'all'; } elsif ($1 eq 'q') { $quiet = 1; } shift(@ARGV); if (my $cmd = $dist_cmd{$1}) { delete $ENV{'PAR_TEMP'}; init_inc(); require PAR::Dist; &{"PAR::Dist::$cmd"}() unless @ARGV; &{"PAR::Dist::$cmd"}($_) for @ARGV; exit; } } } # XXX -- add --par-debug support! # }}} # Output mode (-O) handling {{{ if ($out) { require IO::File; require Archive::Zip; my $par = shift(@ARGV); my $zip = Archive::Zip->new($par) if defined($par); my %env = do { if ($zip and my $meta = $zip->contents('META.yml')) { $meta =~ s/.*^par:$//ms; $meta =~ s/^\S.*//ms; $meta =~ /^ ([^:]+): (.+)$/mg; } }; # Open input and output files {{{ local $/ = \4; if (defined $par) { open PAR, '<', $par or die "$!: $par"; binmode(PAR); die "$par is not a PAR file" unless <PAR> eq "PK\003\004"; } my $fh = IO::File->new( $out, IO::File::O_CREAT() | IO::File::O_WRONLY() | IO::File::O_TRUNC(), 0777, ) or die $!; binmode($fh); $/ = (defined $data_pos) ? \$data_pos : undef; seek _FH, 0, 0; my $loader = scalar <_FH>; if (!$ENV{PAR_VERBATIM} and $loader =~ /^(?:#!|\@rem)/) { require PAR::Filter::PodStrip; PAR::Filter::PodStrip->new->apply(\$loader, $0) } foreach my $key (sort keys %env) { my $val = $env{$key} or next; $val = eval $val if $val =~ /^['"]/; my $magic = "__ENV_PAR_" . uc($key) . "__"; my $set = "PAR_" . uc($key) . "=$val"; $loader =~ s{$magic( +)}{ $magic . $set . (' ' x (length($1) - length($set))) }eg; } $fh->print($loader); $/ = undef; # }}} # Write bundled modules {{{ if ($bundle) { require PAR::Heavy; PAR::Heavy::_init_dynaloader(); init_inc(); require_modules(); my @inc = sort { length($b) <=> length($a) } grep { !/BSDPAN/ } grep { ($bundle ne 'site') or ($_ ne $Config::Config{archlibexp} and $_ ne $Config::Config{privlibexp}); } @INC; if ($Config{_delim} eq '\\') { s{\\}{/}g for @inc } my %files; /^_<(.+)$/ and $files{$1}++ for keys %::; $files{$_}++ for values %INC; my $lib_ext = $Config::Config{lib_ext}; my %written; foreach (sort keys %files) { my ($name, $file); foreach my $dir (@inc) { if ($name = $PAR::Heavy::FullCache{$_}) { $file = $_; last; } elsif (/^(\Q$dir\E\/(.*[^Cc]))\Z/i) { ($file, $name) = ($1, $2); last; } elsif (m!^/loader/[^/]+/(.*[^Cc])\Z!) { if (my $ref = $PAR::Heavy::ModuleCache{$1}) { ($file, $name) = ($ref, $1); last; } elsif (-f "$dir/$1") { ($file, $name) = ("$dir/$1", $1); last; } } } next unless defined $name and not $written{$name}++; next if !ref($file) and $file =~ /\.\Q$lib_ext\E$/; outs( join "", qq(Packing "), ref $file ? $file->{name} : $file, qq("...) ); my $content; if (ref($file)) { $content = $file->{buf}; } else { open FILE, "$file" or die "Can't open $file: $!"; binmode(FILE); $content = <FILE>; close FILE; PAR::Filter::PodStrip->new->apply(\$content, $file) if !$ENV{PAR_VERBATIM} and lc($name) =~ /\.(?:pm|ix|al)$/i; } outs(qq(Written as "$name")); $fh->print("FILE"); $fh->print(pack('N', length($name) + 9)); $fh->print(sprintf( "%08x/%s", Archive::Zip::computeCRC32($content), $name )); $fh->print(pack('N', length($content))); $fh->print($content); } } # }}} # Now write out the PAR and magic strings {{{ $zip->writeToFileHandle($fh) if $zip; $fh->print(pack('N', $fh->tell - length($loader))); $fh->print("\nPAR.pm\n"); $fh->close; chmod 0755, $out; # }}} exit; } # }}} # Prepare $0 into PAR file cache {{{ { last unless defined $start_pos; # Now load the PAR file and put it into PAR::LibCache {{{ require PAR; PAR::Heavy::_init_dynaloader(); require Archive::Zip; my $zip = Archive::Zip->new; my $fh = IO::File->new; $fh->fdopen(fileno(_FH), 'r') or die "$!: $@"; $zip->readFromFileHandle($fh) == Archive::Zip::AZ_OK() or die "$!: $@"; push @PAR::LibCache, $zip; $PAR::LibCache{$0} = $zip; $quiet = !$ENV{PAR_DEBUG}; outs(qq(\$ENV{PAR_TEMP} = "$ENV{PAR_TEMP}")); foreach my $member ( $zip->members ) { next if $member->isDirectory or !$ENV{PAR_TEMP}; my $member_name = $member->fileName; next unless $member_name =~ m{ ^ /?shlib/ (?:$Config::Config{version}/)? (?:$Config::Config{archname}/)? ([^/]+) $ }x; my $extract_name = $1; my $dest_name = File::Spec->catfile($ENV{PAR_TEMP}, $extract_name); $member->extractToFileNamed($dest_name); outs(qq(Extracting "$member_name" to "$dest_name")); } # }}} } # }}} # If there's no main.pl to run, show usage {{{ unless ($PAR::LibCache{$0}) { die << "." unless @ARGV; Usage: $0 [ -Alib.par ] [ -Idir ] [ -Mmodule ] [ src.par ] [ program.pl ] $0 [ -B|-b ] [-Ooutfile] src.par . $0 = shift(@ARGV); } # }}} sub require_modules { require lib; require DynaLoader; require integer; require strict; require warnings; require vars; require Carp; require Carp::Heavy; require Exporter::Heavy; require Exporter; require Fcntl; require Cwd; require File::Temp; require File::Spec; require XSLoader; require Config; require IO::File; require Compress::Zlib; require Archive::Zip; require PAR; require PAR::Heavy; require PAR::Dist; require PAR::Filter::PodStrip; } # The C version of this code appears in myldr/mktmpdir.c sub _set_par_temp { if ($ENV{PAR_TEMP} and $ENV{PAR_TEMP} =~ /(.+)/) { $par_temp = $1; return; } foreach my $path ( (map $ENV{$_}, qw( TMPDIR TEMP TMP )), qw( "C:\\TEMP /tmp . ) ) { next unless $path and -d $path and -w $path; my $username = defined(&Win32::LoginName) ? &Win32::LoginName() : $ENV{USERNAME} || $ENV{USER} || 'SYSTEM'; my $stmpdir = "$path$Config{_delim}par-$username"; mkdir $stmpdir, 0755; if (!$ENV{PAR_CLEAN} and my $mtime = (stat($progname))[9]) { my $ctx = eval { require Digest::SHA1; Digest::SHA1->new } || eval { require Digest::MD5; Digest::MD5->new }; if ($ctx and open(my $fh, "<$progname")) { binmode($fh); $ctx->addfile($fh); close($fh); } $stmpdir .= "$Config{_delim}cache-" . ( $ctx ? $ctx->hexdigest : $mtime ); } else { $ENV{PAR_CLEAN} = 1; $stmpdir .= "$Config{_delim}temp-$$"; } $ENV{PAR_TEMP} = $stmpdir; mkdir $stmpdir, 0755; last; } $par_temp = $1 if $ENV{PAR_TEMP} and $ENV{PAR_TEMP} =~ /(.+)/; } sub _tempfile { my ($ext, $crc) = @_; my ($fh, $filename); $filename = "$par_temp/$crc$ext"; if ($ENV{PAR_CLEAN}) { unlink $filename if -e $filename; push @tmpfile, $filename; } else { return (undef, $filename) if (-r $filename); } open $fh, '>', $filename or die $!; binmode($fh); return($fh, $filename); } sub _set_progname { if ($ENV{PAR_PROGNAME} and $ENV{PAR_PROGNAME} =~ /(.+)/) { $progname = $1; } return if -s ($progname ||= $0); if (-s "$progname$Config{_exe}") { $ENV{PAR_PROGNAME} = $progname = "$progname$Config{_exe}"; $0 .= $Config{_exe}; return $progname; } foreach my $dir (split /\Q$Config{path_sep}\E/, $ENV{PATH}) { $dir =~ s/\Q$Config{_delim}\E$//; (($progname = "$dir$Config{_delim}$progname$Config{_exe}"), last) if -s "$dir$Config{_delim}$progname$Config{_exe}"; (($progname = "$dir$Config{_delim}$progname"), last) if -s "$dir$Config{_delim}$progname"; } $ENV{PAR_PROGNAME} = $progname; } sub _par_init_env { return if $ENV{PAR_INITIALIZED}++; my $par_clean = "__ENV_PAR_CLEAN__ "; if ($ENV{PAR_TEMP}) { delete $ENV{PAR_CLEAN}; } elsif (!$ENV{PAR_CLEAN}) { my $value = substr($par_clean, 12 + length("CLEAN")); $ENV{PAR_CLEAN} = $1 if $value =~ /^PAR_CLEAN=(\S+)/; } } sub outs { warn("@_\n") unless $quiet } sub init_inc { require Config; push @INC, grep defined, map $Config::Config{$_}, qw( archlibexp privlibexp sitearchexp sitelibexp vendorarchexp vendorlibexp ); } ######################################################################## # The main package for script execution package main; require PAR; unshift @INC, \&PAR::find_par; PAR->import(@par_args); die qq(Can't open perl script "$0": No such file or directory\n) unless -e $0; do $0; die $@ if $@; }; $::__ERROR = $@ if $@; } die $::__ERROR if $::__ERROR; 1; #line 776 __END__ FILE d1a42b7f/AutoLoader.pm #line 1 "/usr/lib/perl5/5.8.0/AutoLoader.pm" package AutoLoader; use 5.006_001; our(@EXPORT, @EXPORT_OK, $VERSION); my $is_dosish; my $is_epoc; my $is_vms; my $is_macos; BEGIN { require Exporter; @EXPORT = @EXPORT = (); @EXPORT_OK = @EXPORT_OK = qw(AUTOLOAD); $is_dosish = $^O eq 'dos' || $^O eq 'os2' || $^O eq 'MSWin32' || $^O eq 'NetWare'; $is_epoc = $^O eq 'epoc'; $is_vms = $^O eq 'VMS'; $is_macos = $^O eq 'MacOS'; $VERSION = '5.59'; } AUTOLOAD { my $sub = $AUTOLOAD; my $filename; # Braces used to preserve $1 et al. { # Try to find the autoloaded file from the package-qualified # name of the sub. e.g., if the sub needed is # Getopt::Long::GetOptions(), then $INC{Getopt/Long.pm} is # something like '/usr/lib/perl5/Getopt/Long.pm', and the # autoload file is '/usr/lib/perl5/auto/Getopt/Long/GetOptions.al'. # # However, if @INC is a relative path, this might not work. If, # for example, @INC = ('lib'), then $INC{Getopt/Long.pm} is # 'lib/Getopt/Long.pm', and we want to require # 'auto/Getopt/Long/GetOptions.al' (without the leading 'lib'). # In this case, we simple prepend the 'auto/' and let the # C<require> take care of the searching for us. my ($pkg,$func) = ($sub =~ /(.*)::([^:]+)$/); $pkg =~ s#::#/#g; if (defined($filename = $INC{"$pkg.pm"})) { if ($is_macos) { $pkg =~ tr#/#:#; $filename =~ s#^(.*)$pkg\.pm\z#$1auto:$pkg:$func.al#s; } else { $filename =~ s#^(.*)$pkg\.pm\z#$1auto/$pkg/$func.al#s; } # if the file exists, then make sure that it is a # a fully anchored path (i.e either '/usr/lib/auto/foo/bar.al', # or './lib/auto/foo/bar.al'. This avoids C<require> searching # (and failing) to find the 'lib/auto/foo/bar.al' because it # looked for 'lib/lib/auto/foo/bar.al', given @INC = ('lib'). if (-r $filename) { unless ($filename =~ m|^/|s) { if ($is_dosish) { unless ($filename =~ m{^([a-z]:)?[\\/]}is) { if ($^O ne 'NetWare') { $filename = "./$filename"; } else { $filename = "$filename"; } } } elsif ($is_epoc) { unless ($filename =~ m{^([a-z?]:)?[\\/]}is) { $filename = "./$filename"; } } elsif ($is_vms) { # XXX todo by VMSmiths $filename = "./$filename"; } elsif (!$is_macos) { $filename = "./$filename"; } } } else { $filename = undef; } } unless (defined $filename) { # let C<require> do the searching $filename = "auto/$sub.al"; $filename =~ s#::#/#g; } } my $save = $@; local $!; # Do not munge the value. eval { local $SIG{__DIE__}; require $filename }; if ($@) { if (substr($sub,-9) eq '::DESTROY') { *$sub = sub {}; } else { # The load might just have failed because the filename was too # long for some old SVR3 systems which treat long names as errors. # If we can succesfully truncate a long name then it's worth a go. # There is a slight risk that we could pick up the wrong file here # but autosplit should have warned about that when splitting. if ($filename =~ s/(\w{12,})\.al$/substr($1,0,11).".al"/e){ eval { local $SIG{__DIE__}; require $filename }; } if ($@){ $@ =~ s/ at .*\n//; my $error = $@; require Carp; Carp::croak($error); } } } $@ = $save; goto &$sub; } sub import { my $pkg = shift; my $callpkg = caller; # # Export symbols, but not by accident of inheritance. # if ($pkg eq 'AutoLoader') { local $Exporter::ExportLevel = 1; Exporter::import $pkg, @_; } # # Try to find the autosplit index file. Eg., if the call package # is POSIX, then $INC{POSIX.pm} is something like # '/usr/local/lib/perl5/POSIX.pm', and the autosplit index file is in # '/usr/local/lib/perl5/auto/POSIX/autosplit.ix', so we require that. # # However, if @INC is a relative path, this might not work. If, # for example, @INC = ('lib'), then # $INC{POSIX.pm} is 'lib/POSIX.pm', and we want to require # 'auto/POSIX/autosplit.ix' (without the leading 'lib'). # (my $calldir = $callpkg) =~ s#::#/#g; my $path = $INC{$calldir . '.pm'}; if (defined($path)) { # Try absolute path name. if ($is_macos) { (my $malldir = $calldir) =~ tr#/#:#; $path =~ s#^(.*)$malldir\.pm\z#$1auto:$malldir:autosplit.ix#s; } else { $path =~ s#^(.*)$calldir\.pm\z#$1auto/$calldir/autosplit.ix#; } eval { require $path; }; # If that failed, try relative path with normal @INC searching. if ($@) { $path ="auto/$calldir/autosplit.ix"; eval { require $path; }; } if ($@) { my $error = $@; require Carp; Carp::carp($error); } } } sub unimport { my $callpkg = caller; eval "package $callpkg; sub AUTOLOAD;"; } 1; __END__ #line 338 FILE c3e70214/Carp.pm A#line 1 "/usr/lib/perl5/5.8.0/Carp.pm" package Carp; our $VERSION = '1.01'; #line 105 # This package is heavily used. Be small. Be fast. Be good. # Comments added by Andy Wardley <abw@kfs.org> 09-Apr-98, based on an # _almost_ complete understanding of the package. Corrections and # comments are welcome. # The members of %Internal are packages that are internal to perl. # Carp will not report errors from within these packages if it # can. The members of %CarpInternal are internal to Perl's warning # system. Carp will not report errors from within these packages # either, and will not report calls *to* these packages for carp and # croak. They replace $CarpLevel, which is deprecated. The # $Max(EvalLen|(Arg(Len|Nums)) variables are used to specify how the eval # text and function arguments should be formatted when printed. $CarpInternal{Carp}++; $CarpInternal{warnings}++; $CarpLevel = 0; # How many extra package levels to skip on carp. # How many calls to skip on confess. # Reconciling these notions is hard, use # %Internal and %CarpInternal instead. $MaxEvalLen = 0; # How much eval '...text...' to show. 0 = all. $MaxArgLen = 64; # How much of each argument to print. 0 = all. $MaxArgNums = 8; # How many arguments to print. 0 = all. $Verbose = 0; # If true then make shortmess call longmess instead require Exporter; @ISA = ('Exporter'); @EXPORT = qw(confess croak carp); @EXPORT_OK = qw(cluck verbose longmess shortmess); @EXPORT_FAIL = qw(verbose); # hook to enable verbose mode # if the caller specifies verbose usage ("perl -MCarp=verbose script.pl") # then the following method will be called by the Exporter which knows # to do this thanks to @EXPORT_FAIL, above. $_[1] will contain the word # 'verbose'. sub export_fail { shift; $Verbose = shift if $_[0] eq 'verbose'; return @_; } # longmess() crawls all the way up the stack reporting on all the function # calls made. The error string, $error, is originally constructed from the # arguments passed into longmess() via confess(), cluck() or shortmess(). # This gets appended with the stack trace messages which are generated for # each function call on the stack. sub longmess { { local $@; require Carp::Heavy; } # XXX fix require to not clear $@? # Icky backwards compatibility wrapper. :-( my $call_pack = caller(); if ($Internal{$call_pack} or $CarpInternal{$call_pack}) { return longmess_heavy(@_); } else { local $CarpLevel = $CarpLevel + 1; return longmess_heavy(@_); } } # shortmess() is called by carp() and croak() to skip all the way up to # the top-level caller's package and report the error from there. confess() # and cluck() generate a full stack trace so they call longmess() to # generate that. In verbose mode shortmess() calls longmess() so # you always get a stack trace sub shortmess { # Short-circuit &longmess if called via multiple packages { local $@; require Carp::Heavy; } # XXX fix require to not clear $@? # Icky backwards compatibility wrapper. :-( my $call_pack = caller(); local @CARP_NOT = caller(); shortmess_heavy(@_); } # the following four functions call longmess() or shortmess() depending on # whether they should generate a full stack trace (confess() and cluck()) # or simply report the caller's package (croak() and carp()), respectively. # confess() and croak() die, carp() and cluck() warn. sub croak { die shortmess @_ } sub confess { die longmess @_ } sub carp { warn shortmess @_ } sub cluck { warn longmess @_ } 1; FILE e05a6a96/Carp/Heavy.pm #line 1 "/usr/lib/perl5/5.8.0/Carp/Heavy.pm" # Carp::Heavy uses some variables in common with Carp. package Carp; #line 9 # use strict; # not yet # On one line so MakeMaker will see it. use Carp; our $VERSION = $Carp::VERSION; our ($CarpLevel, $MaxArgNums, $MaxEvalLen, $MaxArgLen, $Verbose); sub caller_info { my $i = shift(@_) + 1; package DB; my %call_info; @call_info{ qw(pack file line sub has_args wantarray evaltext is_require) } = caller($i); unless (defined $call_info{pack}) { return (); } my $sub_name = Carp::get_subname(\%call_info); if ($call_info{has_args}) { my @args = map {Carp::format_arg($_)} @DB::args; if ($MaxArgNums and @args > $MaxArgNums) { # More than we want to show? $#args = $MaxArgNums; push @args, '...'; } # Push the args onto the subroutine $sub_name .= '(' . join (',', @args) . ')'; } $call_info{sub_name} = $sub_name; return wantarray() ? %call_info : \%call_info; } # Transform an argument to a function into a string. sub format_arg { my $arg = shift; if (not defined($arg)) { $arg = 'undef'; } elsif (ref($arg)) { $arg = defined($overload::VERSION) ? overload::StrVal($arg) : "$arg"; } $arg =~ s/'/\\'/g; $arg = str_len_trim($arg, $MaxArgLen); # Quote it? $arg = "'$arg'" unless $arg =~ /^-?[\d.]+\z/; # The following handling of "control chars" is direct from # the original code - I think it is broken on Unicode though. # Suggestions? $arg =~ s/([[:cntrl:]]|[[:^ascii:]])/sprintf("\\x{%x}",ord($1))/eg; return $arg; } # Takes an inheritance cache and a package and returns # an anon hash of known inheritances and anon array of # inheritances which consequences have not been figured # for. sub get_status { my $cache = shift; my $pkg = shift; $cache->{$pkg} ||= [{$pkg => $pkg}, [trusts_directly($pkg)]]; return @{$cache->{$pkg}}; } # Takes the info from caller() and figures out the name of # the sub/require/eval sub get_subname { my $info = shift; if (defined($info->{evaltext})) { my $eval = $info->{evaltext}; if ($info->{is_require}) { return "require $eval"; } else { $eval =~ s/([\\\'])/\\$1/g; return "eval '" . str_len_trim($eval, $MaxEvalLen) . "'"; } } return ($info->{sub} eq '(eval)') ? 'eval {...}' : $info->{sub}; } # Figures out what call (from the point of view of the caller) # the long error backtrace should start at. sub long_error_loc { my $i; my $lvl = $CarpLevel; { my $pkg = caller(++$i); unless(defined($pkg)) { # This *shouldn't* happen. if (%Internal) { local %Internal; $i = long_error_loc(); last; } else { # OK, now I am irritated. return 2; } } redo if $CarpInternal{$pkg}; redo unless 0 > --$lvl; redo if $Internal{$pkg}; } return $i - 1; } sub longmess_heavy { return @_ if ref($_[0]); # don't break references as exceptions my $i = long_error_loc(); return ret_backtrace($i, @_); } # Returns a full stack backtrace starting from where it is # told. sub ret_backtrace { my ($i, @error) = @_; my $mess; my $err = join '', @error; $i++; my $tid_msg = ''; if (defined &Thread::tid) { my $tid = Thread->self->tid; $tid_msg = " thread $tid" if $tid; } { if ($err =~ /\n$/) { # extra block to localise $1 etc $mess = $err; } else { my %i = caller_info($i); $mess = "$err at $i{file} line $i{line}$tid_msg\n"; }} while (my %i = caller_info(++$i)) { $mess .= "\t$i{sub_name} called at $i{file} line $i{line}$tid_msg\n"; } return $mess; } sub ret_summary { my ($i, @error) = @_; my $mess; my $err = join '', @error; $i++; my $tid_msg = ''; if (defined &Thread::tid) { my $tid = Thread->self->tid; $tid_msg = " thread $tid" if $tid; } my %i = caller_info($i); return "$err at $i{file} line $i{line}$tid_msg\n"; } sub short_error_loc { my $cache; my $i = 1; my $lvl = $CarpLevel; { my $called = caller($i++); my $caller = caller($i); return 0 unless defined($caller); # What happened? redo if $Internal{$caller}; redo if $CarpInternal{$called}; redo if trusts($called, $caller, $cache); redo if trusts($caller, $called, $cache); redo unless 0 > --$lvl; } return $i - 1; } sub shortmess_heavy { return longmess_heavy(@_) if $Verbose; return @_ if ref($_[0]); # don't break references as exceptions my $i = short_error_loc(); if ($i) { ret_summary($i, @_); } else { longmess_heavy(@_); } } # If a string is too long, trims it with ... sub str_len_trim { my $str = shift; my $max = shift || 0; if (2 < $max and $max < length($str)) { substr($str, $max - 3) = '...'; } return $str; } # Takes two packages and an optional cache. Says whether the # first inherits from the second. # # Recursive versions of this have to work to avoid certain # possible endless loops, and when following long chains of # inheritance are less efficient. sub trusts { my $child = shift; my $parent = shift; my $cache = shift || {}; my ($known, $partial) = get_status($cache, $child); # Figure out consequences until we have an answer while (@$partial and not exists $known->{$parent}) { my $anc = shift @$partial; next if exists $known->{$anc}; $known->{$anc}++; my ($anc_knows, $anc_partial) = get_status($cache, $anc); my @found = keys %$anc_knows; @$known{@found} = (); push @$partial, @$anc_partial; } return exists $known->{$parent}; } # Takes a package and gives a list of those trusted directly sub trusts_directly { my $class = shift; no strict 'refs'; no warnings 'once'; return @{"$class\::CARP_NOT"} ? @{"$class\::CARP_NOT"} : @{"$class\::ISA"}; } 1; FILE 4febd417/Digest/base.pm #line 1 "/usr/lib/perl5/5.8.0/Digest/base.pm" package Digest::base; use strict; use vars qw($VERSION); $VERSION = "1.00"; # subclass is supposed to implement at least these sub new; sub clone; sub add; sub digest; sub reset { my $self = shift; $self->new(@_); # ugly } sub addfile { my ($self, $handle) = @_; my $n; my $buf = ""; while (($n = read($handle, $buf, 4*1024))) { $self->add($buf); } unless (defined $n) { require Carp; Carp::croak("Read failed: $!"); } $self; } sub add_bits { my $self = shift; my $bits; my $nbits; if (@_ == 1) { my $arg = shift; $bits = pack("B*", $arg); $nbits = length($arg); } else { ($bits, $nbits) = @_; } if (($nbits % 8) != 0) { require Carp; Carp::croak("Number of bits must be multiple of 8 for this algorithm"); } return $self->add(substr($bits, 0, $nbits/8)); } sub hexdigest { my $self = shift; return unpack("H*", $self->digest(@_)); } sub b64digest { my $self = shift; require MIME::Base64; my $b64 = MIME::Base64::encode($self->digest(@_), ""); $b64 =~ s/=+$//; return $b64; } 1; __END__ #line 101FILE 2a1b4dac/Exporter.pm ]#line 1 "/usr/lib/perl5/5.8.0/Exporter.pm" package Exporter; require 5.006; # Be lean. #use strict; #no strict 'refs'; our $Debug = 0; our $ExportLevel = 0; our $Verbose ||= 0; our $VERSION = '5.566'; $Carp::Internal{Exporter} = 1; sub as_heavy { require Exporter::Heavy; # Unfortunately, this does not work if the caller is aliased as *name = \&foo # Thus the need to create a lot of identical subroutines my $c = (caller(1))[3]; $c =~ s/.*:://; \&{"Exporter::Heavy::heavy_$c"}; } sub export { goto &{as_heavy()}; } sub import { my $pkg = shift; my $callpkg = caller($ExportLevel); # We *need* to treat @{"$pkg\::EXPORT_FAIL"} since Carp uses it :-( my($exports, $export_cache, $fail) = (\@{"$pkg\::EXPORT"}, \%{"$pkg\::EXPORT"}, \@{"$pkg\::EXPORT_FAIL"}); return export $pkg, $callpkg, @_ if $Verbose or $Debug or @$fail > 1; my $args = @_ or @_ = @$exports; local $_; if ($args and not %$export_cache) { s/^&//, $export_cache->{$_} = 1 foreach (@$exports, @{"$pkg\::EXPORT_OK"}); } my $heavy; # Try very hard not to use {} and hence have to enter scope on the foreach # We bomb out of the loop with last as soon as heavy is set. if ($args or $fail) { ($heavy = (/\W/ or $args and not exists $export_cache->{$_} or @$fail and $_ eq $fail->[0])) and last foreach (@_); } else { ($heavy = /\W/) and last foreach (@_); } return export $pkg, $callpkg, ($args ? @_ : ()) if $heavy; local $SIG{__WARN__} = sub {require Carp; &Carp::carp}; # shortcut for the common case of no type character *{"$callpkg\::$_"} = \&{"$pkg\::$_"} foreach @_; } # Default methods sub export_fail { my $self = shift; @_; } # Unfortunately, caller(1)[3] "does not work" if the caller is aliased as # *name = \&foo. Thus the need to create a lot of identical subroutines # Otherwise we could have aliased them to export(). sub export_to_level { goto &{as_heavy()}; } sub export_tags { goto &{as_heavy()}; } sub export_ok_tags { goto &{as_heavy()}; } sub require_version { goto &{as_heavy()}; } 1; __END__ #line 417 FILE 3a75438c/Exporter/Heavy.pm #line 1 "/usr/lib/perl5/5.8.0/Exporter/Heavy.pm" package Exporter::Heavy; use strict; no strict 'refs'; # On one line so MakeMaker will see it. require Exporter; our $VERSION = $Exporter::VERSION; $Carp::Internal{"Exporter::Heavy"} = 1; our $Verbose; #line 24 # # We go to a lot of trouble not to 'require Carp' at file scope, # because Carp requires Exporter, and something has to give. # sub heavy_export { # First make import warnings look like they're coming from the "use". local $SIG{__WARN__} = sub { my $text = shift; if ($text =~ s/ at \S*Exporter\S*.pm line \d+.*\n//) { require Carp; local $Carp::CarpLevel = 1; # ignore package calling us too. Carp::carp($text); } else { warn $text; } }; local $SIG{__DIE__} = sub { require Carp; local $Carp::CarpLevel = 1; # ignore package calling us too. Carp::croak("$_[0]Illegal null symbol in \@${1}::EXPORT") if $_[0] =~ /^Unable to create sub named "(.*?)::"/; }; my($pkg, $callpkg, @imports) = @_; my($type, $sym, $oops); my($exports, $export_cache) = (\@{"${pkg}::EXPORT"}, \%{"${pkg}::EXPORT"}); if (@imports) { if (!%$export_cache) { s/^&// foreach @$exports; @{$export_cache}{@$exports} = (1) x @$exports; my $ok = \@{"${pkg}::EXPORT_OK"}; if (@$ok) { s/^&// foreach @$ok; @{$export_cache}{@$ok} = (1) x @$ok; } } if ($imports[0] =~ m#^[/!:]#){ my $tagsref = \%{"${pkg}::EXPORT_TAGS"}; my $tagdata; my %imports; my($remove, $spec, @names, @allexports); # negated first item implies starting with default set: unshift @imports, ':DEFAULT' if $imports[0] =~ m/^!/; foreach $spec (@imports){ $remove = $spec =~ s/^!//; if ($spec =~ s/^://){ if ($spec eq 'DEFAULT'){ @names = @$exports; } elsif ($tagdata = $tagsref->{$spec}) { @names = @$tagdata; } else { warn qq["$spec" is not defined in %${pkg}::EXPORT_TAGS]; ++$oops; next; } } elsif ($spec =~ m:^/(.*)/$:){ my $patn = $1; @allexports = keys %$export_cache unless @allexports; # only do keys once @names = grep(/$patn/, @allexports); # not anchored by default } else { @names = ($spec); # is a normal symbol name } warn "Import ".($remove ? "del":"add").": @names " if $Verbose; if ($remove) { foreach $sym (@names) { delete $imports{$sym} } } else { @imports{@names} = (1) x @names; } } @imports = keys %imports; } my @carp; foreach $sym (@imports) { if (!$export_cache->{$sym}) { if ($sym =~ m/^\d/) { $pkg->VERSION($sym); # inherit from UNIVERSAL # If the version number was the only thing specified # then we should act as if nothing was specified: if (@imports == 1) { @imports = @$exports; last; } # We need a way to emulate 'use Foo ()' but still # allow an easy version check: "use Foo 1.23, ''"; if (@imports == 2 and !$imports[1]) { @imports = (); last; } } elsif ($sym !~ s/^&// || !$export_cache->{$sym}) { # accumulate the non-exports push @carp, qq["$sym" is not exported by the $pkg module\n]; $oops++; } } } if ($oops) { require Carp; Carp::croak("@{carp}Can't continue after import errors"); } } else { @imports = @$exports; } my($fail, $fail_cache) = (\@{"${pkg}::EXPORT_FAIL"}, \%{"${pkg}::EXPORT_FAIL"}); if (@$fail) { if (!%$fail_cache) { # Build cache of symbols. Optimise the lookup by adding # barewords twice... both with and without a leading &. # (Technique could be applied to $export_cache at cost of memory) my @expanded = map { /^\w/ ? ($_, '&'.$_) : $_ } @$fail; warn "${pkg}::EXPORT_FAIL cached: @expanded" if $Verbose; @{$fail_cache}{@expanded} = (1) x @expanded; } my @failed; foreach $sym (@imports) { push(@failed, $sym) if $fail_cache->{$sym} } if (@failed) { @failed = $pkg->export_fail(@failed); foreach $sym (@failed) { require Carp; Carp::carp(qq["$sym" is not implemented by the $pkg module ], "on this architecture"); } if (@failed) { require Carp; Carp::croak("Can't continue after import errors"); } } } warn "Importing into $callpkg from $pkg: ", join(", ",sort @imports) if $Verbose; foreach $sym (@imports) { # shortcut for the common case of no type character (*{"${callpkg}::$sym"} = \&{"${pkg}::$sym"}, next) unless $sym =~ s/^(\W)//; $type = $1; *{"${callpkg}::$sym"} = $type eq '&' ? \&{"${pkg}::$sym"} : $type eq '$' ? \${"${pkg}::$sym"} : $type eq '@' ? \@{"${pkg}::$sym"} : $type eq '%' ? \%{"${pkg}::$sym"} : $type eq '*' ? *{"${pkg}::$sym"} : do { require Carp; Carp::croak("Can't export symbol: $type$sym") }; } } sub heavy_export_to_level { my $pkg = shift; my $level = shift; (undef) = shift; # XXX redundant arg my $callpkg = caller($level); $pkg->export($callpkg, @_); } # Utility functions sub _push_tags { my($pkg, $var, $syms) = @_; my @nontag = (); my $export_tags = \%{"${pkg}::EXPORT_TAGS"}; push(@{"${pkg}::$var"}, map { $export_tags->{$_} ? @{$export_tags->{$_}} : scalar(push(@nontag,$_),$_) } (@$syms) ? @$syms : keys %$export_tags); if (@nontag and $^W) { # This may change to a die one day require Carp; Carp::carp(join(", ", @nontag)." are not tags of $pkg"); } } sub heavy_require_version { my($self, $wanted) = @_; my $pkg = ref $self || $self; return ${pkg}->VERSION($wanted); } sub heavy_export_tags { _push_tags((caller)[0], "EXPORT", \@_); } sub heavy_export_ok_tags { _push_tags((caller)[0], "EXPORT_OK", \@_); } 1; FILE d71140dc/File/Basename.pm *#line 1 "/usr/lib/perl5/5.8.0/File/Basename.pm" package File::Basename; #line 125 ## use strict; # A bit of juggling to insure that C<use re 'taint';> always works, since # File::Basename is used during the Perl build, when the re extension may # not be available. BEGIN { unless (eval { require re; }) { eval ' sub re::import { $^H |= 0x00100000; } ' } import re 'taint'; } use 5.006; use warnings; our(@ISA, @EXPORT, $VERSION, $Fileparse_fstype, $Fileparse_igncase); require Exporter; @ISA = qw(Exporter); @EXPORT = qw(fileparse fileparse_set_fstype basename dirname); $VERSION = "2.71"; # fileparse_set_fstype() - specify OS-based rules used in future # calls to routines in this package # # Currently recognized values: VMS, MSDOS, MacOS, AmigaOS, os2, RISCOS # Any other name uses Unix-style rules and is case-sensitive sub fileparse_set_fstype { my @old = ($Fileparse_fstype, $Fileparse_igncase); if (@_) { $Fileparse_fstype = $_[0]; $Fileparse_igncase = ($_[0] =~ /^(?:MacOS|VMS|AmigaOS|os2|RISCOS|MSWin32|MSDOS)/i); } wantarray ? @old : $old[0]; } # fileparse() - parse file specification # # Version 2.4 27-Sep-1996 Charles Bailey bailey@genetics.upenn.edu sub fileparse { my($fullname,@suffices) = @_; unless (defined $fullname) { require Carp; Carp::croak "fileparse(): need a valid pathname"; } my($fstype,$igncase) = ($Fileparse_fstype, $Fileparse_igncase); my($dirpath,$tail,$suffix,$basename); my($taint) = substr($fullname,0,0); # Is $fullname tainted? if ($fstype =~ /^VMS/i) { if ($fullname =~ m#/#) { $fstype = '' } # We're doing Unix emulation else { ($dirpath,$basename) = ($fullname =~ /^(.*[:>\]])?(.*)/s); $dirpath ||= ''; # should always be defined } } if ($fstype =~ /^MS(DOS|Win32)|epoc/i) { ($dirpath,$basename) = ($fullname =~ /^((?:.*[:\\\/])?)(.*)/s); $dirpath .= '.\\' unless $dirpath =~ /[\\\/]\z/; } elsif ($fstype =~ /^os2/i) { ($dirpath,$basename) = ($fullname =~ m#^((?:.*[:\\/])?)(.*)#s); $dirpath = './' unless $dirpath; # Can't be 0 $dirpath .= '/' unless $dirpath =~ m#[\\/]\z#; } elsif ($fstype =~ /^MacOS/si) { ($dirpath,$basename) = ($fullname =~ /^(.*:)?(.*)/s); $dirpath = ':' unless $dirpath; } elsif ($fstype =~ /^AmigaOS/i) { ($dirpath,$basename) = ($fullname =~ /(.*[:\/])?(.*)/s); $dirpath = './' unless $dirpath; } elsif ($fstype !~ /^VMS/i) { # default to Unix ($dirpath,$basename) = ($fullname =~ m#^(.*/)?(.*)#s); if ($^O eq 'VMS' and $fullname =~ m:^(/[^/]+/000000(/|$))(.*):) { # dev:[000000] is top of VMS tree, similar to Unix '/' # so strip it off and treat the rest as "normal" my $devspec = $1; my $remainder = $3; ($dirpath,$basename) = ($remainder =~ m#^(.*/)?(.*)#s); $dirpath ||= ''; # should always be defined $dirpath = $devspec.$dirpath; } $dirpath = './' unless $dirpath; } if (@suffices) { $tail = ''; foreach $suffix (@suffices) { my $pat = ($igncase ? '(?i)' : '') . "($suffix)\$"; if ($basename =~ s/$pat//s) { $taint .= substr($suffix,0,0); $tail = $1 . $tail; } } } $tail .= $taint if defined $tail; # avoid warning if $tail == undef wantarray ? ($basename .= $taint, $dirpath .= $taint, $tail) : ($basename .= $taint); } # basename() - returns first element of list returned by fileparse() sub basename { my($name) = shift; (fileparse($name, map("\Q$_\E",@_)))[0]; } # dirname() - returns device and directory portion of file specification # Behavior matches that of Unix dirname(1) exactly for Unix and MSDOS # filespecs except for names ending with a separator, e.g., "/xx/yy/". # This differs from the second element of the list returned # by fileparse() in that the trailing '/' (Unix) or '\' (MSDOS) (and # the last directory name if the filespec ends in a '/' or '\'), is lost. sub dirname { my($basename,$dirname) = fileparse($_[0]); my($fstype) = $Fileparse_fstype; if ($fstype =~ /VMS/i) { if ($_[0] =~ m#/#) { $fstype = '' } else { return $dirname || $ENV{DEFAULT} } } if ($fstype =~ /MacOS/i) { if( !length($basename) && $dirname !~ /^[^:]+:\z/) { $dirname =~ s/([^:]):\z/$1/s; ($basename,$dirname) = fileparse $dirname; } $dirname .= ":" unless $dirname =~ /:\z/; } elsif ($fstype =~ /MS(DOS|Win32)|os2/i) { $dirname =~ s/([^:])[\\\/]*\z/$1/; unless( length($basename) ) { ($basename,$dirname) = fileparse $dirname; $dirname =~ s/([^:])[\\\/]*\z/$1/; } } elsif ($fstype =~ /AmigaOS/i) { if ( $dirname =~ /:\z/) { return $dirname } chop $dirname; $dirname =~ s#[^:/]+\z## unless length($basename); } else { $dirname =~ s:(.)/*\z:$1:s; unless( length($basename) ) { local($File::Basename::Fileparse_fstype) = $fstype; ($basename,$dirname) = fileparse $dirname; $dirname =~ s:(.)/*\z:$1:s; } } $dirname; } fileparse_set_fstype $^O; 1; FILE 7a8bf744/File/Copy.pm #line 1 "/usr/lib/perl5/5.8.0/File/Copy.pm" # File/Copy.pm. Written in 1994 by Aaron Sherman <ajs@ajs.com>. This # source code has been placed in the public domain by the author. # Please be kind and preserve the documentation. # # Additions copyright 1996 by Charles Bailey. Permission is granted # to distribute the revised code under the same terms as Perl itself. package File::Copy; use 5.006; use strict; use warnings; use Carp; use File::Spec; use Config; our(@ISA, @EXPORT, @EXPORT_OK, $VERSION, $Too_Big, $Syscopy_is_copy); sub copy; sub syscopy; sub cp; sub mv; # Note that this module implements only *part* of the API defined by # the File/Copy.pm module of the File-Tools-2.0 package. However, that # package has not yet been updated to work with Perl 5.004, and so it # would be a Bad Thing for the CPAN module to grab it and replace this # module. Therefore, we set this module's version higher than 2.0. $VERSION = '2.05'; require Exporter; @ISA = qw(Exporter); @EXPORT = qw(copy move); @EXPORT_OK = qw(cp mv); $Too_Big = 1024 * 1024 * 2; my $macfiles; if ($^O eq 'MacOS') { $macfiles = eval { require Mac::MoreFiles }; warn 'Mac::MoreFiles could not be loaded; using non-native syscopy' if $^W; } sub _catname { my($from, $to) = @_; if (not defined &basename) { require File::Basename; import File::Basename 'basename'; } if ($^O eq 'MacOS') { # a partial dir name that's valid only in the cwd (e.g. 'tmp') $to = ':' . $to if $to !~ /:/; } return File::Spec->catfile($to, basename($from)); } sub copy { croak("Usage: copy(FROM, TO [, BUFFERSIZE]) ") unless(@_ == 2 || @_ == 3); my $from = shift; my $to = shift; my $from_a_handle = (ref($from) ? (ref($from) eq 'GLOB' || UNIVERSAL::isa($from, 'GLOB') || UNIVERSAL::isa($from, 'IO::Handle')) : (ref(\$from) eq 'GLOB')); my $to_a_handle = (ref($to) ? (ref($to) eq 'GLOB' || UNIVERSAL::isa($to, 'GLOB') || UNIVERSAL::isa($to, 'IO::Handle')) : (ref(\$to) eq 'GLOB')); if ($from eq $to) { # works for references, too croak("'$from' and '$to' are identical (not copied)"); } if ($Config{d_symlink} && $Config{d_readlink} && !($^O eq 'Win32' || $^O eq 'os2' || $^O eq 'vms')) { no warnings 'io'; # don't warn if -l on filehandle if ((-e $from && -l $from) || (-e $to && -l $to)) { my @fs = stat($from); my @ts = stat($to); if (@fs && @ts && $fs[0] == $ts[0] && $fs[1] == $ts[1]) { croak("'$from' and '$to' are identical (not copied)"); } } } if (!$from_a_handle && !$to_a_handle && -d $to && ! -d $from) { $to = _catname($from, $to); } if (defined &syscopy && !$Syscopy_is_copy && !$to_a_handle && !($from_a_handle && $^O eq 'os2' ) # OS/2 cannot handle handles && !($from_a_handle && $^O eq 'mpeix') # and neither can MPE/iX. && !($from_a_handle && $^O eq 'MSWin32') && !($from_a_handle && $^O eq 'MacOS') && !($from_a_handle && $^O eq 'NetWare') ) { return syscopy($from, $to); } my $closefrom = 0; my $closeto = 0; my ($size, $status, $r, $buf); local($\) = ''; my $from_h; if ($from_a_handle) { $from_h = $from; } else { $from = _protect($from) if $from =~ /^\s/s; $from_h = \do { local *FH }; open($from_h, "< $from\0") or goto fail_open1; binmode $from_h or die "($!,$^E)"; $closefrom = 1; } my $to_h; if ($to_a_handle) { $to_h = $to; } else { $to = _protect($to) if $to =~ /^\s/s; $to_h = \do { local *FH }; open($to_h,"> $to\0") or goto fail_open2; binmode $to_h or die "($!,$^E)"; $closeto = 1; } if (@_) { $size = shift(@_) + 0; croak("Bad buffer size for copy: $size\n") unless ($size > 0); } else { $size = tied(*$from_h) ? 0 : -s $from_h || 0; $size = 1024 if ($size < 512); $size = $Too_Big if ($size > $Too_Big); } $! = 0; for (;;) { my ($r, $w, $t); defined($r = sysread($from_h, $buf, $size)) or goto fail_inner; last unless $r; for ($w = 0; $w < $r; $w += $t) { $t = syswrite($to_h, $buf, $r - $w, $w) or goto fail_inner; } } close($to_h) || goto fail_open2 if $closeto; close($from_h) || goto fail_open1 if $closefrom; # Use this idiom to avoid uninitialized value warning. return 1; # All of these contortions try to preserve error messages... fail_inner: if ($closeto) { $status = $!; $! = 0; close $to_h; $! = $status unless $!; } fail_open2: if ($closefrom) { $status = $!; $! = 0; close $from_h; $! = $status unless $!; } fail_open1: return 0; } sub move { my($from,$to) = @_; my($copied,$fromsz,$tosz1,$tomt1,$tosz2,$tomt2,$sts,$ossts); if (-d $to && ! -d $from) { $to = _catname($from, $to); } ($tosz1,$tomt1) = (stat($to))[7,9]; $fromsz = -s $from; if ($^O eq 'os2' and defined $tosz1 and defined $fromsz) { # will not rename with overwrite unlink $to; } return 1 if rename $from, $to; ($sts,$ossts) = ($! + 0, $^E + 0); # Did rename return an error even though it succeeded, because $to # is on a remote NFS file system, and NFS lost the server's ack? return 1 if defined($fromsz) && !-e $from && # $from disappeared (($tosz2,$tomt2) = (stat($to))[7,9]) && # $to's there ($tosz1 != $tosz2 or $tomt1 != $tomt2) && # and changed $tosz2 == $fromsz; # it's all there ($tosz1,$tomt1) = (stat($to))[7,9]; # just in case rename did something return 1 if ($copied = copy($from,$to)) && unlink($from); ($tosz2,$tomt2) = ((stat($to))[7,9],0,0) if defined $tomt1; unlink($to) if !defined($tomt1) or $tomt1 != $tomt2 or $tosz1 != $tosz2; ($!,$^E) = ($sts,$ossts); return 0; } *cp = \© *mv = \&move; if ($^O eq 'MacOS') { *_protect = sub { MacPerl::MakeFSSpec($_[0]) }; } else { *_protect = sub { "./$_[0]" }; } # &syscopy is an XSUB under OS/2 unless (defined &syscopy) { if ($^O eq 'VMS') { *syscopy = \&rmscopy; } elsif ($^O eq 'mpeix') { *syscopy = sub { return 0 unless @_ == 2; # Use the MPE cp program in order to # preserve MPE file attributes. return system('/bin/cp', '-f', $_[0], $_[1]) == 0; }; } elsif ($^O eq 'MSWin32') { *syscopy = sub { return 0 unless @_ == 2; return Win32::CopyFile(@_, 1); }; } elsif ($macfiles) { *syscopy = sub { my($from, $to) = @_; my($dir, $toname); return 0 unless -e $from; if ($to =~ /(.*:)([^:]+):?$/) { ($dir, $toname) = ($1, $2); } else { ($dir, $toname) = (":", $to); } unlink($to); Mac::MoreFiles::FSpFileCopy($from, $dir, $toname, 1); }; } else { $Syscopy_is_copy = 1; *syscopy = \© } } 1; __END__ #line 443 FILE 29a9b292/File/Find.pm U#line 1 "/usr/lib/perl5/5.8.0/File/Find.pm" package File::Find; use 5.006; use strict; use warnings; use warnings::register; our $VERSION = '1.04'; require Exporter; require Cwd; #line 383 our @ISA = qw(Exporter); our @EXPORT = qw(find finddepth); use strict; my $Is_VMS; my $Is_MacOS; require File::Basename; require File::Spec; # Should ideally be my() not our() but local() currently # refuses to operate on lexicals our %SLnkSeen; our ($wanted_callback, $avoid_nlink, $bydepth, $no_chdir, $follow, $follow_skip, $full_check, $untaint, $untaint_skip, $untaint_pat, $pre_process, $post_process, $dangling_symlinks); sub contract_name { my ($cdir,$fn) = @_; return substr($cdir,0,rindex($cdir,'/')) if $fn eq $File::Find::current_dir; $cdir = substr($cdir,0,rindex($cdir,'/')+1); $fn =~ s|^\./||; my $abs_name= $cdir . $fn; if (substr($fn,0,3) eq '../') { 1 while $abs_name =~ s!/[^/]*/\.\./!/!; } return $abs_name; } # return the absolute name of a directory or file sub contract_name_Mac { my ($cdir,$fn) = @_; my $abs_name; if ($fn =~ /^(:+)(.*)$/) { # valid pathname starting with a ':' my $colon_count = length ($1); if ($colon_count == 1) { $abs_name = $cdir . $2; return $abs_name; } else { # need to move up the tree, but # only if it's not a volume name for (my $i=1; $i<$colon_count; $i++) { unless ($cdir =~ /^[^:]+:$/) { # volume name $cdir =~ s/[^:]+:$//; } else { return undef; } } $abs_name = $cdir . $2; return $abs_name; } } else { # $fn may be a valid path to a directory or file or (dangling) # symlink, without a leading ':' if ( (-e $fn) || (-l $fn) ) { if ($fn =~ /^[^:]+:/) { # a volume name like DataHD:* return $fn; # $fn is already an absolute path } else { $abs_name = $cdir . $fn; return $abs_name; } } else { # argh!, $fn is not a valid directory/file return undef; } } } sub PathCombine($$) { my ($Base,$Name) = @_; my $AbsName; if ($Is_MacOS) { # $Name is the resolved symlink (always a full path on MacOS), # i.e. there's no need to call contract_name_Mac() $AbsName = $Name; # (simple) check for recursion if ( ( $Base =~ /^$AbsName/) && (-d $AbsName) ) { # recursion return undef; } } else { if (substr($Name,0,1) eq '/') { $AbsName= $Name; } else { $AbsName= contract_name($Base,$Name); } # (simple) check for recursion my $newlen= length($AbsName); if ($newlen <= length($Base)) { if (($newlen == length($Base) || substr($Base,$newlen,1) eq '/') && $AbsName eq substr($Base,0,$newlen)) { return undef; } } } return $AbsName; } sub Follow_SymLink($) { my ($AbsName) = @_; my ($NewName,$DEV, $INO); ($DEV, $INO)= lstat $AbsName; while (-l _) { if ($SLnkSeen{$DEV, $INO}++) { if ($follow_skip < 2) { die "$AbsName is encountered a second time"; } else { return undef; } } $NewName= PathCombine($AbsName, readlink($AbsName)); unless(defined $NewName) { if ($follow_skip < 2) { die "$AbsName is a recursive symbolic link"; } else { return undef; } } else { $AbsName= $NewName; } ($DEV, $INO) = lstat($AbsName); return undef unless defined $DEV; # dangling symbolic link } if ($full_check && defined $DEV && $SLnkSeen{$DEV, $INO}++) { if ( ($follow_skip < 1) || ((-d _) && ($follow_skip < 2)) ) { die "$AbsName encountered a second time"; } else { return undef; } } return $AbsName; } our($dir, $name, $fullname, $prune); sub _find_dir_symlnk($$$); sub _find_dir($$$); # check whether or not a scalar variable is tainted # (code straight from the Camel, 3rd ed., page 561) sub is_tainted_pp { my $arg = shift; my $nada = substr($arg, 0, 0); # zero-length local $@; eval { eval "# $nada" }; return length($@) != 0; } sub _find_opt { my $wanted = shift; die "invalid top directory" unless defined $_[0]; # This function must local()ize everything because callbacks may # call find() or finddepth() local %SLnkSeen; local ($wanted_callback, $avoid_nlink, $bydepth, $no_chdir, $follow, $follow_skip, $full_check, $untaint, $untaint_skip, $untaint_pat, $pre_process, $post_process, $dangling_symlinks); local($dir, $name, $fullname, $prune); my $cwd = $wanted->{bydepth} ? Cwd::fastcwd() : Cwd::getcwd(); my $cwd_untainted = $cwd; my $check_t_cwd = 1; $wanted_callback = $wanted->{wanted}; $bydepth = $wanted->{bydepth}; $pre_process = $wanted->{preprocess}; $post_process = $wanted->{postprocess}; $no_chdir = $wanted->{no_chdir}; $full_check = $wanted->{follow}; $follow = $full_check || $wanted->{follow_fast}; $follow_skip = $wanted->{follow_skip}; $untaint = $wanted->{untaint}; $untaint_pat = $wanted->{untaint_pattern}; $untaint_skip = $wanted->{untaint_skip}; $dangling_symlinks = $wanted->{dangling_symlinks}; # for compatibility reasons (find.pl, find2perl) local our ($topdir, $topdev, $topino, $topmode, $topnlink); # a symbolic link to a directory doesn't increase the link count $avoid_nlink = $follow || $File::Find::dont_use_nlink; my ($abs_dir, $Is_Dir); Proc_Top_Item: foreach my $TOP (@_) { my $top_item = $TOP; if ($Is_MacOS) { ($topdev,$topino,$topmode,$topnlink) = $follow ? stat $top_item : lstat $top_item; $top_item = ":$top_item" if ( (-d _) && ( $top_item !~ /:/ ) ); } else { $top_item =~ s|/\z|| unless $top_item eq '/'; ($topdev,$topino,$topmode,$topnlink) = $follow ? stat $top_item : lstat $top_item; } $Is_Dir= 0; if ($follow) { if ($Is_MacOS) { $cwd = "$cwd:" unless ($cwd =~ /:$/); # for safety if ($top_item eq $File::Find::current_dir) { $abs_dir = $cwd; } else { $abs_dir = contract_name_Mac($cwd, $top_item); unless (defined $abs_dir) { warnings::warnif "Can't determine absolute path for $top_item (No such file or directory)\n"; next Proc_Top_Item; } } } else { if (substr($top_item,0,1) eq '/') { $abs_dir = $top_item; } elsif ($top_item eq $File::Find::current_dir) { $abs_dir = $cwd; } else { # care about any ../ $abs_dir = contract_name("$cwd/",$top_item); } } $abs_dir= Follow_SymLink($abs_dir); unless (defined $abs_dir) { if ($dangling_symlinks) { if (ref $dangling_symlinks eq 'CODE') { $dangling_symlinks->($top_item, $cwd); } else { warnings::warnif "$top_item is a dangling symbolic link\n"; } } next Proc_Top_Item; } if (-d _) { _find_dir_symlnk($wanted, $abs_dir, $top_item); $Is_Dir= 1; } } else { # no follow $topdir = $top_item; unless (defined $topnlink) { warnings::warnif "Can't stat $top_item: $!\n"; next Proc_Top_Item; } if (-d _) { $top_item =~ s/\.dir\z// if $Is_VMS; _find_dir($wanted, $top_item, $topnlink); $Is_Dir= 1; } else { $abs_dir= $top_item; } } unless ($Is_Dir) { unless (($_,$dir) = File::Basename::fileparse($abs_dir)) { if ($Is_MacOS) { ($dir,$_) = (':', $top_item); # $File::Find::dir, $_ } else { ($dir,$_) = ('./', $top_item); } } $abs_dir = $dir; if (( $untaint ) && (is_tainted($dir) )) { ( $abs_dir ) = $dir =~ m|$untaint_pat|; unless (defined $abs_dir) { if ($untaint_skip == 0) { die "directory $dir is still tainted"; } else { next Proc_Top_Item; } } } unless ($no_chdir || chdir $abs_dir) { warnings::warnif "Couldn't chdir $abs_dir: $!\n"; next Proc_Top_Item; } $name = $abs_dir . $_; # $File::Find::name { $wanted_callback->() }; # protect against wild "next" } unless ( $no_chdir ) { if ( ($check_t_cwd) && (($untaint) && (is_tainted($cwd) )) ) { ( $cwd_untainted ) = $cwd =~ m|$untaint_pat|; unless (defined $cwd_untainted) { die "insecure cwd in find(depth)"; } $check_t_cwd = 0; } unless (chdir $cwd_untainted) { die "Can't cd to $cwd: $!\n"; } } } } # API: # $wanted # $p_dir : "parent directory" # $nlink : what came back from the stat # preconditions: # chdir (if not no_chdir) to dir sub _find_dir($$$) { my ($wanted, $p_dir, $nlink) = @_; my ($CdLvl,$Level) = (0,0); my @Stack; my @filenames; my ($subcount,$sub_nlink); my $SE= []; my $dir_name= $p_dir; my $dir_pref; my $dir_rel = $File::Find::current_dir; my $tainted = 0; my $no_nlink; if ($Is_MacOS) { $dir_pref= ($p_dir =~ /:$/) ? $p_dir : "$p_dir:"; # preface } else { $dir_pref= ( $p_dir eq '/' ? '/' : "$p_dir/" ); } local ($dir, $name, $prune, *DIR); unless ( $no_chdir || ($p_dir eq $File::Find::current_dir)) { my $udir = $p_dir; if (( $untaint ) && (is_tainted($p_dir) )) { ( $udir ) = $p_dir =~ m|$untaint_pat|; unless (defined $udir) { if ($untaint_skip == 0) { die "directory $p_dir is still tainted"; } else { return; } } } unless (chdir $udir) { warnings::warnif "Can't cd to $udir: $!\n"; return; } } # push the starting directory push @Stack,[$CdLvl,$p_dir,$dir_rel,-1] if $bydepth; if ($Is_MacOS) { $p_dir = $dir_pref; # ensure trailing ':' } while (defined $SE) { unless ($bydepth) { $dir= $p_dir; # $File::Find::dir $name= $dir_name; # $File::Find::name $_= ($no_chdir ? $dir_name : $dir_rel ); # $_ # prune may happen here $prune= 0; { $wanted_callback->() }; # protect against wild "next" next if $prune; } # change to that directory unless ($no_chdir || ($dir_rel eq $File::Find::current_dir)) { my $udir= $dir_rel; if ( ($untaint) && (($tainted) || ($tainted = is_tainted($dir_rel) )) ) { ( $udir ) = $dir_rel =~ m|$untaint_pat|; unless (defined $udir) { if ($untaint_skip == 0) { if ($Is_MacOS) { die "directory ($p_dir) $dir_rel is still tainted"; } else { die "directory (" . ($p_dir ne '/' ? $p_dir : '') . "/) $dir_rel is still tainted"; } } else { # $untaint_skip == 1 next; } } } unless (chdir $udir) { if ($Is_MacOS) { warnings::warnif "Can't cd to ($p_dir) $udir: $!\n"; } else { warnings::warnif "Can't cd to (" . ($p_dir ne '/' ? $p_dir : '') . "/) $udir: $!\n"; } next; } $CdLvl++; } if ($Is_MacOS) { $dir_name = "$dir_name:" unless ($dir_name =~ /:$/); } $dir= $dir_name; # $File::Find::dir # Get the list of files in the current directory. unless (opendir DIR, ($no_chdir ? $dir_name : $File::Find::current_dir)) { warnings::warnif "Can't opendir($dir_name): $!\n"; next; } @filenames = readdir DIR; closedir(DIR); @filenames = $pre_process->(@filenames) if $pre_process; push @Stack,[$CdLvl,$dir_name,"",-2] if $post_process; # default: use whatever was specifid # (if $nlink >= 2, and $avoid_nlink == 0, this will switch back) $no_nlink = $avoid_nlink; # if dir has wrong nlink count, force switch to slower stat method $no_nlink = 1 if ($nlink < 2); if ($nlink == 2 && !$no_nlink) { # This dir has no subdirectories. for my $FN (@filenames) { next if $FN =~ $File::Find::skip_pattern; $name = $dir_pref . $FN; # $File::Find::name $_ = ($no_chdir ? $name : $FN); # $_ { $wanted_callback->() }; # protect against wild "next" } } else { # This dir has subdirectories. $subcount = $nlink - 2; for my $FN (@filenames) { next if $FN =~ $File::Find::skip_pattern; if ($subcount > 0 || $no_nlink) { # Seen all the subdirs? # check for directoriness. # stat is faster for a file in the current directory $sub_nlink = (lstat ($no_chdir ? $dir_pref . $FN : $FN))[3]; if (-d _) { --$subcount; $FN =~ s/\.dir\z// if $Is_VMS; push @Stack,[$CdLvl,$dir_name,$FN,$sub_nlink]; } else { $name = $dir_pref . $FN; # $File::Find::name $_= ($no_chdir ? $name : $FN); # $_ { $wanted_callback->() }; # protect against wild "next" } } else { $name = $dir_pref . $FN; # $File::Find::name $_= ($no_chdir ? $name : $FN); # $_ { $wanted_callback->() }; # protect against wild "next" } } } } continue { while ( defined ($SE = pop @Stack) ) { ($Level, $p_dir, $dir_rel, $nlink) = @$SE; if ($CdLvl > $Level && !$no_chdir) { my $tmp; if ($Is_MacOS) { $tmp = (':' x ($CdLvl-$Level)) . ':'; } else { $tmp = join('/',('..') x ($CdLvl-$Level)); } die "Can't cd to $dir_name" . $tmp unless chdir ($tmp); $CdLvl = $Level; } if ($Is_MacOS) { # $pdir always has a trailing ':', except for the starting dir, # where $dir_rel eq ':' $dir_name = "$p_dir$dir_rel"; $dir_pref = "$dir_name:"; } else { $dir_name = ($p_dir eq '/' ? "/$dir_rel" : "$p_dir/$dir_rel"); $dir_pref = "$dir_name/"; } if ( $nlink == -2 ) { $name = $dir = $p_dir; # $File::Find::name / dir $_ = $File::Find::current_dir; $post_process->(); # End-of-directory processing } elsif ( $nlink < 0 ) { # must be finddepth, report dirname now $name = $dir_name; if ($Is_MacOS) { if ($dir_rel eq ':') { # must be the top dir, where we started $name =~ s|:$||; # $File::Find::name $p_dir = "$p_dir:" unless ($p_dir =~ /:$/); } $dir = $p_dir; # $File::Find::dir $_ = ($no_chdir ? $name : $dir_rel); # $_ } else { if ( substr($name,-2) eq '/.' ) { substr($name, length($name) == 2 ? -1 : -2) = ''; } $dir = $p_dir; $_ = ($no_chdir ? $dir_name : $dir_rel ); if ( substr($_,-2) eq '/.' ) { substr($_, length($_) == 2 ? -1 : -2) = ''; } } { $wanted_callback->() }; # protect against wild "next" } else { push @Stack,[$CdLvl,$p_dir,$dir_rel,-1] if $bydepth; last; } } } } # API: # $wanted # $dir_loc : absolute location of a dir # $p_dir : "parent directory" # preconditions: # chdir (if not no_chdir) to dir sub _find_dir_symlnk($$$) { my ($wanted, $dir_loc, $p_dir) = @_; # $dir_loc is the absolute directory my @Stack; my @filenames; my $new_loc; my $updir_loc = $dir_loc; # untainted parent directory my $SE = []; my $dir_name = $p_dir; my $dir_pref; my $loc_pref; my $dir_rel = $File::Find::current_dir; my $byd_flag; # flag for pending stack entry if $bydepth my $tainted = 0; my $ok = 1; if ($Is_MacOS) { $dir_pref = ($p_dir =~ /:$/) ? "$p_dir" : "$p_dir:"; $loc_pref = ($dir_loc =~ /:$/) ? "$dir_loc" : "$dir_loc:"; } else { $dir_pref = ( $p_dir eq '/' ? '/' : "$p_dir/" ); $loc_pref = ( $dir_loc eq '/' ? '/' : "$dir_loc/" ); } local ($dir, $name, $fullname, $prune, *DIR); unless ($no_chdir) { # untaint the topdir if (( $untaint ) && (is_tainted($dir_loc) )) { ( $updir_loc ) = $dir_loc =~ m|$untaint_pat|; # parent dir, now untainted # once untainted, $updir_loc is pushed on the stack (as parent directory); # hence, we don't need to untaint the parent directory every time we chdir # to it later unless (defined $updir_loc) { if ($untaint_skip == 0) { die "directory $dir_loc is still tainted"; } else { return; } } } $ok = chdir($updir_loc) unless ($p_dir eq $File::Find::current_dir); unless ($ok) { warnings::warnif "Can't cd to $updir_loc: $!\n"; return; } } push @Stack,[$dir_loc,$updir_loc,$p_dir,$dir_rel,-1] if $bydepth; if ($Is_MacOS) { $p_dir = $dir_pref; # ensure trailing ':' } while (defined $SE) { unless ($bydepth) { # change (back) to parent directory (always untainted) unless ($no_chdir) { unless (chdir $updir_loc) { warnings::warnif "Can't cd to $updir_loc: $!\n"; next; } } $dir= $p_dir; # $File::Find::dir $name= $dir_name; # $File::Find::name $_= ($no_chdir ? $dir_name : $dir_rel ); # $_ $fullname= $dir_loc; # $File::Find::fullname # prune may happen here $prune= 0; lstat($_); # make sure file tests with '_' work { $wanted_callback->() }; # protect against wild "next" next if $prune; } # change to that directory unless ($no_chdir || ($dir_rel eq $File::Find::current_dir)) { $updir_loc = $dir_loc; if ( ($untaint) && (($tainted) || ($tainted = is_tainted($dir_loc) )) ) { # untaint $dir_loc, what will be pushed on the stack as (untainted) parent dir ( $updir_loc ) = $dir_loc =~ m|$untaint_pat|; unless (defined $updir_loc) { if ($untaint_skip == 0) { die "directory $dir_loc is still tainted"; } else { next; } } } unless (chdir $updir_loc) { warnings::warnif "Can't cd to $updir_loc: $!\n"; next; } } if ($Is_MacOS) { $dir_name = "$dir_name:" unless ($dir_name =~ /:$/); } $dir = $dir_name; # $File::Find::dir # Get the list of files in the current directory. unless (opendir DIR, ($no_chdir ? $dir_loc : $File::Find::current_dir)) { warnings::warnif "Can't opendir($dir_loc): $!\n"; next; } @filenames = readdir DIR; closedir(DIR); for my $FN (@filenames) { next if $FN =~ $File::Find::skip_pattern; # follow symbolic links / do an lstat $new_loc = Follow_SymLink($loc_pref.$FN); # ignore if invalid symlink next unless defined $new_loc; if (-d _) { push @Stack,[$new_loc,$updir_loc,$dir_name,$FN,1]; } else { $fullname = $new_loc; # $File::Find::fullname $name = $dir_pref . $FN; # $File::Find::name $_ = ($no_chdir ? $name : $FN); # $_ { $wanted_callback->() }; # protect against wild "next" } } } continue { while (defined($SE = pop @Stack)) { ($dir_loc, $updir_loc, $p_dir, $dir_rel, $byd_flag) = @$SE; if ($Is_MacOS) { # $p_dir always has a trailing ':', except for the starting dir, # where $dir_rel eq ':' $dir_name = "$p_dir$dir_rel"; $dir_pref = "$dir_name:"; $loc_pref = ($dir_loc =~ /:$/) ? $dir_loc : "$dir_loc:"; } else { $dir_name = ($p_dir eq '/' ? "/$dir_rel" : "$p_dir/$dir_rel"); $dir_pref = "$dir_name/"; $loc_pref = "$dir_loc/"; } if ( $byd_flag < 0 ) { # must be finddepth, report dirname now unless ($no_chdir || ($dir_rel eq $File::Find::current_dir)) { unless (chdir $updir_loc) { # $updir_loc (parent dir) is always untainted warnings::warnif "Can't cd to $updir_loc: $!\n"; next; } } $fullname = $dir_loc; # $File::Find::fullname $name = $dir_name; # $File::Find::name if ($Is_MacOS) { if ($dir_rel eq ':') { # must be the top dir, where we started $name =~ s|:$||; # $File::Find::name $p_dir = "$p_dir:" unless ($p_dir =~ /:$/); } $dir = $p_dir; # $File::Find::dir $_ = ($no_chdir ? $name : $dir_rel); # $_ } else { if ( substr($name,-2) eq '/.' ) { substr($name, length($name) == 2 ? -1 : -2) = ''; # $File::Find::name } $dir = $p_dir; # $File::Find::dir $_ = ($no_chdir ? $dir_name : $dir_rel); # $_ if ( substr($_,-2) eq '/.' ) { substr($_, length($_) == 2 ? -1 : -2) = ''; } } lstat($_); # make sure file tests with '_' work { $wanted_callback->() }; # protect against wild "next" } else { push @Stack,[$dir_loc, $updir_loc, $p_dir, $dir_rel,-1] if $bydepth; last; } } } } sub wrap_wanted { my $wanted = shift; if ( ref($wanted) eq 'HASH' ) { if ( $wanted->{follow} || $wanted->{follow_fast}) { $wanted->{follow_skip} = 1 unless defined $wanted->{follow_skip}; } if ( $wanted->{untaint} ) { $wanted->{untaint_pattern} = $File::Find::untaint_pattern unless defined $wanted->{untaint_pattern}; $wanted->{untaint_skip} = 0 unless defined $wanted->{untaint_skip}; } return $wanted; } else { return { wanted => $wanted }; } } sub find { my $wanted = shift; _find_opt(wrap_wanted($wanted), @_); } sub finddepth { my $wanted = wrap_wanted(shift); $wanted->{bydepth} = 1; _find_opt($wanted, @_); } # default $File::Find::skip_pattern = qr/^\.{1,2}\z/; $File::Find::untaint_pattern = qr|^([-+@\w./]+)$|; # These are hard-coded for now, but may move to hint files. if ($^O eq 'VMS') { $Is_VMS = 1; $File::Find::dont_use_nlink = 1; } elsif ($^O eq 'MacOS') { $Is_MacOS = 1; $File::Find::dont_use_nlink = 1; $File::Find::skip_pattern = qr/^Icon\015\z/; $File::Find::untaint_pattern = qr|^(.+)$|; } # this _should_ work properly on all platforms # where File::Find can be expected to work $File::Find::current_dir = File::Spec->curdir || '.'; $File::Find::dont_use_nlink = 1 if $^O eq 'os2' || $^O eq 'dos' || $^O eq 'amigaos' || $^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'epoc' || $^O eq 'qnx' || $^O eq 'nto'; # Set dont_use_nlink in your hint file if your system's stat doesn't # report the number of links in a directory as an indication # of the number of files. # See, e.g. hints/machten.sh for MachTen 2.2. unless ($File::Find::dont_use_nlink) { require Config; $File::Find::dont_use_nlink = 1 if ($Config::Config{'dont_use_nlink'}); } # We need a function that checks if a scalar is tainted. Either use the # Scalar::Util module's tainted() function or our (slower) pure Perl # fallback is_tainted_pp() { local $@; eval { require Scalar::Util }; *is_tainted = $@ ? \&is_tainted_pp : \&Scalar::Util::tainted; } 1; FILE 2512c43f/File/Path.pm #line 1 "/usr/lib/perl5/5.8.0/File/Path.pm" package File::Path; #line 102 use 5.006; use Carp; use File::Basename (); use Exporter (); use strict; use warnings; our $VERSION = "1.05"; our @ISA = qw( Exporter ); our @EXPORT = qw( mkpath rmtree ); my $Is_VMS = $^O eq 'VMS'; my $Is_MacOS = $^O eq 'MacOS'; # These OSes complain if you want to remove a file that you have no # write permission to: my $force_writeable = ($^O eq 'os2' || $^O eq 'dos' || $^O eq 'MSWin32' || $^O eq 'amigaos' || $^O eq 'MacOS' || $^O eq 'epoc'); sub mkpath { my($paths, $verbose, $mode) = @_; # $paths -- either a path string or ref to list of paths # $verbose -- optional print "mkdir $path" for each directory created # $mode -- optional permissions, defaults to 0777 local($")=$Is_MacOS ? ":" : "/"; $mode = 0777 unless defined($mode); $paths = [$paths] unless ref $paths; my(@created,$path); foreach $path (@$paths) { $path .= '/' if $^O eq 'os2' and $path =~ /^\w:\z/s; # feature of CRT # Logic wants Unix paths, so go with the flow. if ($Is_VMS) { next if $path eq '/'; $path = VMS::Filespec::unixify($path); if ($path =~ m:^(/[^/]+)/?\z:) { $path = $1.'/000000'; } } next if -d $path; my $parent = File::Basename::dirname($path); unless (-d $parent or $path eq $parent) { push(@created,mkpath($parent, $verbose, $mode)); } print "mkdir $path\n" if $verbose; unless (mkdir($path,$mode)) { my $e = $!; # allow for another process to have created it meanwhile croak "mkdir $path: $e" unless -d $path; } push(@created, $path); } @created; } sub rmtree { my($roots, $verbose, $safe) = @_; my(@files); my($count) = 0; $verbose ||= 0; $safe ||= 0; if ( defined($roots) && length($roots) ) { $roots = [$roots] unless ref $roots; } else { carp "No root path(s) specified\n"; return 0; } my($root); foreach $root (@{$roots}) { if ($Is_MacOS) { $root = ":$root" if $root !~ /:/; $root =~ s#([^:])\z#$1:#; } else { $root =~ s#/\z##; } (undef, undef, my $rp) = lstat $root or next; $rp &= 07777; # don't forget setuid, setgid, sticky bits if ( -d _ ) { # notabene: 0777 is for making readable in the first place, # it's also intended to change it to writable in case we have # to recurse in which case we are better than rm -rf for # subtrees with strange permissions chmod(0777, ($Is_VMS ? VMS::Filespec::fileify($root) : $root)) or carp "Can't make directory $root read+writeable: $!" unless $safe; if (opendir my $d, $root) { no strict 'refs'; if (!defined ${"\cTAINT"} or ${"\cTAINT"}) { # Blindly untaint dir names @files = map { /^(.*)$/s ; $1 } readdir $d; } else { @files = readdir $d; } closedir $d; } else { carp "Can't read $root: $!"; @files = (); } # Deleting large numbers of files from VMS Files-11 filesystems # is faster if done in reverse ASCIIbetical order @files = reverse @files if $Is_VMS; ($root = VMS::Filespec::unixify($root)) =~ s#\.dir\z## if $Is_VMS; if ($Is_MacOS) { @files = map("$root$_", @files); } else { @files = map("$root/$_", grep $_!~/^\.{1,2}\z/s,@files); } $count += rmtree(\@files,$verbose,$safe); if ($safe && ($Is_VMS ? !&VMS::Filespec::candelete($root) : !-w $root)) { print "skipped $root\n" if $verbose; next; } chmod 0777, $root or carp "Can't make directory $root writeable: $!" if $force_writeable; print "rmdir $root\n" if $verbose; if (rmdir $root) { ++$count; } else { carp "Can't remove directory $root: $!"; chmod($rp, ($Is_VMS ? VMS::Filespec::fileify($root) : $root)) or carp("and can't restore permissions to " . sprintf("0%o",$rp) . "\n"); } } else { if ($safe && ($Is_VMS ? !&VMS::Filespec::candelete($root) : !(-l $root || -w $root))) { print "skipped $root\n" if $verbose; next; } chmod 0666, $root or carp "Can't make file $root writeable: $!" if $force_writeable; print "unlink $root\n" if $verbose; # delete all versions under VMS for (;;) { unless (unlink $root) { carp "Can't unlink file $root: $!"; if ($force_writeable) { chmod $rp, $root or carp("and can't restore permissions to " . sprintf("0%o",$rp) . "\n"); } last; } ++$count; last unless $Is_VMS && lstat $root; } } } $count; } 1; FILE b5c84fc9/File/Spec.pm (#line 1 "/usr/lib/perl5/5.8.0/File/Spec.pm" package File::Spec; use strict; our(@ISA, $VERSION); $VERSION = 0.83 ; my %module = (MacOS => 'Mac', MSWin32 => 'Win32', os2 => 'OS2', VMS => 'VMS', epoc => 'Epoc', NetWare => 'Win32', # Yes, File::Spec::Win32 works on NetWare. dos => 'OS2', # Yes, File::Spec::OS2 works on DJGPP. cygwin => 'Cygwin'); my $module = $module{$^O} || 'Unix'; require "File/Spec/$module.pm"; @ISA = ("File::Spec::$module"); 1; __END__ #line 293FILE b9239034/File/Spec/Unix.pm i#line 1 "/usr/lib/perl5/5.8.0/File/Spec/Unix.pm" package File::Spec::Unix; use strict; our($VERSION); $VERSION = '1.4'; use Cwd; #line 36 sub canonpath { my ($self,$path) = @_; # Handle POSIX-style node names beginning with double slash (qnx, nto) # Handle network path names beginning with double slash (cygwin) # (POSIX says: "a pathname that begins with two successive slashes # may be interpreted in an implementation-defined manner, although # more than two leading slashes shall be treated as a single slash.") my $node = ''; if ( $^O =~ m/^(?:qnx|nto|cygwin)$/ && $path =~ s:^(//[^/]+)(/|\z):/:s ) { $node = $1; } # This used to be # $path =~ s|/+|/|g unless($^O eq 'cygwin'); # but that made tests 29, 30, 35, 46, and 213 (as of #13272) to fail # (Mainly because trailing "" directories didn't get stripped). # Why would cygwin avoid collapsing multiple slashes into one? --jhi $path =~ s|/+|/|g; # xx////xx -> xx/xx $path =~ s@(/\.)+(/|\Z(?!\n))@/@g; # xx/././xx -> xx/xx $path =~ s|^(\./)+||s unless $path eq "./"; # ./xx -> xx $path =~ s|^/(\.\./)+|/|s; # /../../xx -> xx $path =~ s|/\Z(?!\n)|| unless $path eq "/"; # xx/ -> xx return "$node$path"; } #line 71 sub catdir { my $self = shift; my @args = @_; foreach (@args) { # append a slash to each argument unless it has one there $_ .= "/" if $_ eq '' || substr($_,-1) ne "/"; } return $self->canonpath(join('', @args)); } #line 88 sub catfile { my $self = shift; my $file = pop @_; return $file unless @_; my $dir = $self->catdir(@_); $dir .= "/" unless substr($dir,-1) eq "/"; return $dir.$file; } #line 103 sub curdir { return "."; } #line 113 sub devnull { return "/dev/null"; } #line 123 sub rootdir { return "/"; } #line 140 my $tmpdir; sub tmpdir { return $tmpdir if defined $tmpdir; my @dirlist = ($ENV{TMPDIR}, "/tmp"); { no strict 'refs'; if (${"\cTAINT"}) { # Check for taint mode on perl >= 5.8.0 require Scalar::Util; shift @dirlist if Scalar::Util::tainted($ENV{TMPDIR}); } } foreach (@dirlist) { next unless defined && -d && -w _; $tmpdir = $_; last; } $tmpdir = '' unless defined $tmpdir; return $tmpdir; } #line 166 sub updir { return ".."; } #line 177 sub no_upwards { my $self = shift; return grep(!/^\.{1,2}\Z(?!\n)/s, @_); } #line 189 sub case_tolerant { return 0; } #line 203 sub file_name_is_absolute { my ($self,$file) = @_; return scalar($file =~ m:^/:s); } #line 214 sub path { my @path = split(':', $ENV{PATH}); foreach (@path) { $_ = '.' if $_ eq '' } return @path; } #line 226 sub join { my $self = shift; return $self->catfile(@_); } #line 251 sub splitpath { my ($self,$path, $nofile) = @_; my ($volume,$directory,$file) = ('','',''); if ( $nofile ) { $directory = $path; } else { $path =~ m|^ ( (?: .* / (?: \.\.?\Z(?!\n) )? )? ) ([^/]*) |xs; $directory = $1; $file = $2; } return ($volume,$directory,$file); } #line 293 sub splitdir { my ($self,$directories) = @_ ; # # split() likes to forget about trailing null fields, so here we # check to be sure that there will not be any before handling the # simple case. # if ( $directories !~ m|/\Z(?!\n)| ) { return split( m|/|, $directories ); } else { # # since there was a trailing separator, add a file name to the end, # then do the split, then replace it with ''. # my( @directories )= split( m|/|, "${directories}dummy" ) ; $directories[ $#directories ]= '' ; return @directories ; } } #line 324 sub catpath { my ($self,$volume,$directory,$file) = @_; if ( $directory ne '' && $file ne '' && substr( $directory, -1 ) ne '/' && substr( $file, 0, 1 ) ne '/' ) { $directory .= "/$file" ; } else { $directory .= $file ; } return $directory ; } #line 371 sub abs2rel { my($self,$path,$base) = @_; # Clean up $path if ( ! $self->file_name_is_absolute( $path ) ) { $path = $self->rel2abs( $path ) ; } else { $path = $self->canonpath( $path ) ; } # Figure out the effective $base and clean it up. if ( !defined( $base ) || $base eq '' ) { $base = cwd() ; } elsif ( ! $self->file_name_is_absolute( $base ) ) { $base = $self->rel2abs( $base ) ; } else { $base = $self->canonpath( $base ) ; } # Now, remove all leading components that are the same my @pathchunks = $self->splitdir( $path); my @basechunks = $self->splitdir( $base); while (@pathchunks && @basechunks && $pathchunks[0] eq $basechunks[0]) { shift @pathchunks ; shift @basechunks ; } $path = CORE::join( '/', @pathchunks ); $base = CORE::join( '/', @basechunks ); # $base now contains the directories the resulting relative path # must ascend out of before it can descend to $path_directory. So, # replace all names with $parentDir $base =~ s|[^/]+|..|g ; # Glue the two together, using a separator if necessary, and preventing an # empty result. if ( $path ne '' && $base ne '' ) { $path = "$base/$path" ; } else { $path = "$base$path" ; } return $self->canonpath( $path ) ; } #line 449 sub rel2abs { my ($self,$path,$base ) = @_; # Clean up $path if ( ! $self->file_name_is_absolute( $path ) ) { # Figure out the effective $base and clean it up. if ( !defined( $base ) || $base eq '' ) { $base = cwd() ; } elsif ( ! $self->file_name_is_absolute( $base ) ) { $base = $self->rel2abs( $base ) ; } else { $base = $self->canonpath( $base ) ; } # Glom them together $path = $self->catdir( $base, $path ) ; } return $self->canonpath( $path ) ; } #line 481 1; FILE 5d739427/File/Temp.pm #line 1 "/usr/lib/perl5/5.8.0/File/Temp.pm" package File::Temp; #line 119 # 5.6.0 gives us S_IWOTH, S_IWGRP, our and auto-vivifying filehandls # People would like a version on 5.005 so give them what they want :-) use 5.005; use strict; use Carp; use File::Spec 0.8; use File::Path qw/ rmtree /; use Fcntl 1.03; use Errno; require VMS::Stdio if $^O eq 'VMS'; # Need the Symbol package if we are running older perl require Symbol if $] < 5.006; # use 'our' on v5.6.0 use vars qw($VERSION @EXPORT_OK %EXPORT_TAGS $DEBUG); $DEBUG = 0; # We are exporting functions use base qw/Exporter/; # Export list - to allow fine tuning of export table @EXPORT_OK = qw{ tempfile tempdir tmpnam tmpfile mktemp mkstemp mkstemps mkdtemp unlink0 }; # Groups of functions for export %EXPORT_TAGS = ( 'POSIX' => [qw/ tmpnam tmpfile /], 'mktemp' => [qw/ mktemp mkstemp mkstemps mkdtemp/], ); # add contents of these tags to @EXPORT Exporter::export_tags('POSIX','mktemp'); # Version number $VERSION = '0.13'; # This is a list of characters that can be used in random filenames my @CHARS = (qw/ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 _ /); # Maximum number of tries to make a temp file before failing use constant MAX_TRIES => 10; # Minimum number of X characters that should be in a template use constant MINX => 4; # Default template when no template supplied use constant TEMPXXX => 'X' x 10; # Constants for the security level use constant STANDARD => 0; use constant MEDIUM => 1; use constant HIGH => 2; # OPENFLAGS. If we defined the flag to use with Sysopen here this gives # us an optimisation when many temporary files are requested my $OPENFLAGS = O_CREAT | O_EXCL | O_RDWR; unless ($^O eq 'MacOS') { for my $oflag (qw/ FOLLOW BINARY LARGEFILE EXLOCK NOINHERIT /) { my ($bit, $func) = (0, "Fcntl::O_" . $oflag); no strict 'refs'; $OPENFLAGS |= $bit if eval { # Make sure that redefined die handlers do not cause problems # eg CGI::Carp local $SIG{__DIE__} = sub {}; local $SIG{__WARN__} = sub {}; $bit = &$func(); 1; }; } } # On some systems the O_TEMPORARY flag can be used to tell the OS # to automatically remove the file when it is closed. This is fine # in most cases but not if tempfile is called with UNLINK=>0 and # the filename is requested -- in the case where the filename is to # be passed to another routine. This happens on windows. We overcome # this by using a second open flags variable my $OPENTEMPFLAGS = $OPENFLAGS; unless ($^O eq 'MacOS') { for my $oflag (qw/ TEMPORARY /) { my ($bit, $func) = (0, "Fcntl::O_" . $oflag); no strict 'refs'; $OPENTEMPFLAGS |= $bit if eval { # Make sure that redefined die handlers do not cause problems # eg CGI::Carp local $SIG{__DIE__} = sub {}; local $SIG{__WARN__} = sub {}; $bit = &$func(); 1; }; } } # INTERNAL ROUTINES - not to be used outside of package # Generic routine for getting a temporary filename # modelled on OpenBSD _gettemp() in mktemp.c # The template must contain X's that are to be replaced # with the random values # Arguments: # TEMPLATE - string containing the XXXXX's that is converted # to a random filename and opened if required # Optionally, a hash can also be supplied containing specific options # "open" => if true open the temp file, else just return the name # default is 0 # "mkdir"=> if true, we are creating a temp directory rather than tempfile # default is 0 # "suffixlen" => number of characters at end of PATH to be ignored. # default is 0. # "unlink_on_close" => indicates that, if possible, the OS should remove # the file as soon as it is closed. Usually indicates # use of the O_TEMPORARY flag to sysopen. # Usually irrelevant on unix # Optionally a reference to a scalar can be passed into the function # On error this will be used to store the reason for the error # "ErrStr" => \$errstr # "open" and "mkdir" can not both be true # "unlink_on_close" is not used when "mkdir" is true. # The default options are equivalent to mktemp(). # Returns: # filehandle - open file handle (if called with doopen=1, else undef) # temp name - name of the temp file or directory # For example: # ($fh, $name) = _gettemp($template, "open" => 1); # for the current version, failures are associated with # stored in an error string and returned to give the reason whilst debugging # This routine is not called by any external function sub _gettemp { croak 'Usage: ($fh, $name) = _gettemp($template, OPTIONS);' unless scalar(@_) >= 1; # the internal error string - expect it to be overridden # Need this in case the caller decides not to supply us a value # need an anonymous scalar my $tempErrStr; # Default options my %options = ( "open" => 0, "mkdir" => 0, "suffixlen" => 0, "unlink_on_close" => 0, "ErrStr" => \$tempErrStr, ); # Read the template my $template = shift; if (ref($template)) { # Use a warning here since we have not yet merged ErrStr carp "File::Temp::_gettemp: template must not be a reference"; return (); } # Check that the number of entries on stack are even if (scalar(@_) % 2 != 0) { # Use a warning here since we have not yet merged ErrStr carp "File::Temp::_gettemp: Must have even number of options"; return (); } # Read the options and merge with defaults %options = (%options, @_) if @_; # Make sure the error string is set to undef ${$options{ErrStr}} = undef; # Can not open the file and make a directory in a single call if ($options{"open"} && $options{"mkdir"}) { ${$options{ErrStr}} = "doopen and domkdir can not both be true\n"; return (); } # Find the start of the end of the Xs (position of last X) # Substr starts from 0 my $start = length($template) - 1 - $options{"suffixlen"}; # Check that we have at least MINX x X (eg 'XXXX") at the end of the string # (taking suffixlen into account). Any fewer is insecure. # Do it using substr - no reason to use a pattern match since # we know where we are looking and what we are looking for if (substr($template, $start - MINX + 1, MINX) ne 'X' x MINX) { ${$options{ErrStr}} = "The template must contain at least ". MINX . " 'X' characters\n"; return (); } # Replace all the X at the end of the substring with a # random character or just all the XX at the end of a full string. # Do it as an if, since the suffix adjusts which section to replace # and suffixlen=0 returns nothing if used in the substr directly # and generate a full path from the template my $path = _replace_XX($template, $options{"suffixlen"}); # Split the path into constituent parts - eventually we need to check # whether the directory exists # We need to know whether we are making a temp directory # or a tempfile my ($volume, $directories, $file); my $parent; # parent directory if ($options{"mkdir"}) { # There is no filename at the end ($volume, $directories, $file) = File::Spec->splitpath( $path, 1); # The parent is then $directories without the last directory # Split the directory and put it back together again my @dirs = File::Spec->splitdir($directories); # If @dirs only has one entry (i.e. the directory template) that means # we are in the current directory if ($#dirs == 0) { $parent = File::Spec->curdir; } else { if ($^O eq 'VMS') { # need volume to avoid relative dir spec $parent = File::Spec->catdir($volume, @dirs[0..$#dirs-1]); $parent = 'sys$disk:[]' if $parent eq ''; } else { # Put it back together without the last one $parent = File::Spec->catdir(@dirs[0..$#dirs-1]); # ...and attach the volume (no filename) $parent = File::Spec->catpath($volume, $parent, ''); } } } else { # Get rid of the last filename (use File::Basename for this?) ($volume, $directories, $file) = File::Spec->splitpath( $path ); # Join up without the file part $parent = File::Spec->catpath($volume,$directories,''); # If $parent is empty replace with curdir $parent = File::Spec->curdir unless $directories ne ''; } # Check that the parent directories exist # Do this even for the case where we are simply returning a name # not a file -- no point returning a name that includes a directory # that does not exist or is not writable unless (-d $parent) { ${$options{ErrStr}} = "Parent directory ($parent) is not a directory"; return (); } unless (-w _) { ${$options{ErrStr}} = "Parent directory ($parent) is not writable\n"; return (); } # Check the stickiness of the directory and chown giveaway if required # If the directory is world writable the sticky bit # must be set if (File::Temp->safe_level == MEDIUM) { my $safeerr; unless (_is_safe($parent,\$safeerr)) { ${$options{ErrStr}} = "Parent directory ($parent) is not safe ($safeerr)"; return (); } } elsif (File::Temp->safe_level == HIGH) { my $safeerr; unless (_is_verysafe($parent, \$safeerr)) { ${$options{ErrStr}} = "Parent directory ($parent) is not safe ($safeerr)"; return (); } } # Now try MAX_TRIES time to open the file for (my $i = 0; $i < MAX_TRIES; $i++) { # Try to open the file if requested if ($options{"open"}) { my $fh; # If we are running before perl5.6.0 we can not auto-vivify if ($] < 5.006) { $fh = &Symbol::gensym; } # Try to make sure this will be marked close-on-exec # XXX: Win32 doesn't respect this, nor the proper fcntl, # but may have O_NOINHERIT. This may or may not be in Fcntl. local $^F = 2; # Store callers umask my $umask = umask(); # Set a known umask umask(066); # Attempt to open the file my $open_success = undef; if ( $^O eq 'VMS' and $options{"unlink_on_close"} ) { # make it auto delete on close by setting FAB$V_DLT bit $fh = VMS::Stdio::vmssysopen($path, $OPENFLAGS, 0600, 'fop=dlt'); $open_success = $fh; } else { my $flags = ( $options{"unlink_on_close"} ? $OPENTEMPFLAGS : $OPENFLAGS ); $open_success = sysopen($fh, $path, $flags, 0600); } if ( $open_success ) { # Reset umask umask($umask) if defined $umask; # Opened successfully - return file handle and name return ($fh, $path); } else { # Reset umask umask($umask) if defined $umask; # Error opening file - abort with error # if the reason was anything but EEXIST unless ($!{EEXIST}) { ${$options{ErrStr}} = "Could not create temp file $path: $!"; return (); } # Loop round for another try } } elsif ($options{"mkdir"}) { # Store callers umask my $umask = umask(); # Set a known umask umask(066); # Open the temp directory if (mkdir( $path, 0700)) { # created okay # Reset umask umask($umask) if defined $umask; return undef, $path; } else { # Reset umask umask($umask) if defined $umask; # Abort with error if the reason for failure was anything # except EEXIST unless ($!{EEXIST}) { ${$options{ErrStr}} = "Could not create directory $path: $!"; return (); } # Loop round for another try } } else { # Return true if the file can not be found # Directory has been checked previously return (undef, $path) unless -e $path; # Try again until MAX_TRIES } # Did not successfully open the tempfile/dir # so try again with a different set of random letters # No point in trying to increment unless we have only # 1 X say and the randomness could come up with the same # file MAX_TRIES in a row. # Store current attempt - in principal this implies that the # 3rd time around the open attempt that the first temp file # name could be generated again. Probably should store each # attempt and make sure that none are repeated my $original = $path; my $counter = 0; # Stop infinite loop my $MAX_GUESS = 50; do { # Generate new name from original template $path = _replace_XX($template, $options{"suffixlen"}); $counter++; } until ($path ne $original || $counter > $MAX_GUESS); # Check for out of control looping if ($counter > $MAX_GUESS) { ${$options{ErrStr}} = "Tried to get a new temp name different to the previous value $MAX_GUESS times.\nSomething wrong with template?? ($template)"; return (); } } # If we get here, we have run out of tries ${ $options{ErrStr} } = "Have exceeded the maximum number of attempts (" . MAX_TRIES . ") to open temp file/dir"; return (); } # Internal routine to return a random character from the # character list. Does not do an srand() since rand() # will do one automatically # No arguments. Return value is the random character # No longer called since _replace_XX runs a few percent faster if # I inline the code. This is important if we are creating thousands of # temporary files. sub _randchar { $CHARS[ int( rand( $#CHARS ) ) ]; } # Internal routine to replace the XXXX... with random characters # This has to be done by _gettemp() every time it fails to # open a temp file/dir # Arguments: $template (the template with XXX), # $ignore (number of characters at end to ignore) # Returns: modified template sub _replace_XX { croak 'Usage: _replace_XX($template, $ignore)' unless scalar(@_) == 2; my ($path, $ignore) = @_; # Do it as an if, since the suffix adjusts which section to replace # and suffixlen=0 returns nothing if used in the substr directly # Alternatively, could simply set $ignore to length($path)-1 # Don't want to always use substr when not required though. if ($ignore) { substr($path, 0, - $ignore) =~ s/X(?=X*\z)/$CHARS[ int( rand( $#CHARS ) ) ]/ge; } else { $path =~ s/X(?=X*\z)/$CHARS[ int( rand( $#CHARS ) ) ]/ge; } return $path; } # internal routine to check to see if the directory is safe # First checks to see if the directory is not owned by the # current user or root. Then checks to see if anyone else # can write to the directory and if so, checks to see if # it has the sticky bit set # Will not work on systems that do not support sticky bit #Args: directory path to check # Optionally: reference to scalar to contain error message # Returns true if the path is safe and false otherwise. # Returns undef if can not even run stat() on the path # This routine based on version written by Tom Christiansen # Presumably, by the time we actually attempt to create the # file or directory in this directory, it may not be safe # anymore... Have to run _is_safe directly after the open. sub _is_safe { my $path = shift; my $err_ref = shift; # Stat path my @info = stat($path); unless (scalar(@info)) { $$err_ref = "stat(path) returned no values"; return 0; }; return 1 if $^O eq 'VMS'; # owner delete control at file level # Check to see whether owner is neither superuser (or a system uid) nor me # Use the real uid from the $< variable # UID is in [4] if ($info[4] > File::Temp->top_system_uid() && $info[4] != $<) { Carp::cluck(sprintf "uid=$info[4] topuid=%s \$<=$< path='$path'", File::Temp->top_system_uid()); $$err_ref = "Directory owned neither by root nor the current user" if ref($err_ref); return 0; } # check whether group or other can write file # use 066 to detect either reading or writing # use 022 to check writability # Do it with S_IWOTH and S_IWGRP for portability (maybe) # mode is in info[2] if (($info[2] & &Fcntl::S_IWGRP) || # Is group writable? ($info[2] & &Fcntl::S_IWOTH) ) { # Is world writable? # Must be a directory unless (-d _) { $$err_ref = "Path ($path) is not a directory" if ref($err_ref); return 0; } # Must have sticky bit set unless (-k _) { $$err_ref = "Sticky bit not set on $path when dir is group|world writable" if ref($err_ref); return 0; } } return 1; } # Internal routine to check whether a directory is safe # for temp files. Safer than _is_safe since it checks for # the possibility of chown giveaway and if that is a possibility # checks each directory in the path to see if it is safe (with _is_safe) # If _PC_CHOWN_RESTRICTED is not set, does the full test of each # directory anyway. # Takes optional second arg as scalar ref to error reason sub _is_verysafe { # Need POSIX - but only want to bother if really necessary due to overhead require POSIX; my $path = shift; print "_is_verysafe testing $path\n" if $DEBUG; return 1 if $^O eq 'VMS'; # owner delete control at file level my $err_ref = shift; # Should Get the value of _PC_CHOWN_RESTRICTED if it is defined # and If it is not there do the extensive test my $chown_restricted; $chown_restricted = &POSIX::_PC_CHOWN_RESTRICTED() if eval { &POSIX::_PC_CHOWN_RESTRICTED(); 1}; # If chown_resticted is set to some value we should test it if (defined $chown_restricted) { # Return if the current directory is safe return _is_safe($path,$err_ref) if POSIX::sysconf( $chown_restricted ); } # To reach this point either, the _PC_CHOWN_RESTRICTED symbol # was not avialable or the symbol was there but chown giveaway # is allowed. Either way, we now have to test the entire tree for # safety. # Convert path to an absolute directory if required unless (File::Spec->file_name_is_absolute($path)) { $path = File::Spec->rel2abs($path); } # Split directory into components - assume no file my ($volume, $directories, undef) = File::Spec->splitpath( $path, 1); # Slightly less efficient than having a function in File::Spec # to chop off the end of a directory or even a function that # can handle ../ in a directory tree # Sometimes splitdir() returns a blank at the end # so we will probably check the bottom directory twice in some cases my @dirs = File::Spec->splitdir($directories); # Concatenate one less directory each time around foreach my $pos (0.. $#dirs) { # Get a directory name my $dir = File::Spec->catpath($volume, File::Spec->catdir(@dirs[0.. $#dirs - $pos]), '' ); print "TESTING DIR $dir\n" if $DEBUG; # Check the directory return 0 unless _is_safe($dir,$err_ref); } return 1; } # internal routine to determine whether unlink works on this # platform for files that are currently open. # Returns true if we can, false otherwise. # Currently WinNT, OS/2 and VMS can not unlink an opened file # On VMS this is because the O_EXCL flag is used to open the # temporary file. Currently I do not know enough about the issues # on VMS to decide whether O_EXCL is a requirement. sub _can_unlink_opened_file { if ($^O eq 'MSWin32' || $^O eq 'os2' || $^O eq 'VMS' || $^O eq 'dos' || $^O eq 'MacOS') { return 0; } else { return 1; } } # internal routine to decide which security levels are allowed # see safe_level() for more information on this # Controls whether the supplied security level is allowed # $cando = _can_do_level( $level ) sub _can_do_level { # Get security level my $level = shift; # Always have to be able to do STANDARD return 1 if $level == STANDARD; # Currently, the systems that can do HIGH or MEDIUM are identical if ( $^O eq 'MSWin32' || $^O eq 'os2' || $^O eq 'cygwin' || $^O eq 'dos' || $^O eq 'MacOS') { return 0; } else { return 1; } } # This routine sets up a deferred unlinking of a specified # filename and filehandle. It is used in the following cases: # - Called by unlink0 if an opened file can not be unlinked # - Called by tempfile() if files are to be removed on shutdown # - Called by tempdir() if directories are to be removed on shutdown # Arguments: # _deferred_unlink( $fh, $fname, $isdir ); # # - filehandle (so that it can be expclicitly closed if open # - filename (the thing we want to remove) # - isdir (flag to indicate that we are being given a directory) # [and hence no filehandle] # Status is not referred to since all the magic is done with an END block { # Will set up two lexical variables to contain all the files to be # removed. One array for files, another for directories # They will only exist in this block # This means we only have to set up a single END block to remove all files # @files_to_unlink contains an array ref with the filehandle and filename my (@files_to_unlink, @dirs_to_unlink); # Set up an end block to use these arrays END { # Files foreach my $file (@files_to_unlink) { # close the filehandle without checking its state # in order to make real sure that this is closed # if its already closed then I dont care about the answer # probably a better way to do this close($file->[0]); # file handle is [0] if (-f $file->[1]) { # file name is [1] unlink $file->[1] or warn "Error removing ".$file->[1]; } } # Dirs foreach my $dir (@dirs_to_unlink) { if (-d $dir) { rmtree($dir, $DEBUG, 1); } } } # This is the sub called to register a file for deferred unlinking # This could simply store the input parameters and defer everything # until the END block. For now we do a bit of checking at this # point in order to make sure that (1) we have a file/dir to delete # and (2) we have been called with the correct arguments. sub _deferred_unlink { croak 'Usage: _deferred_unlink($fh, $fname, $isdir)' unless scalar(@_) == 3; my ($fh, $fname, $isdir) = @_; warn "Setting up deferred removal of $fname\n" if $DEBUG; # If we have a directory, check that it is a directory if ($isdir) { if (-d $fname) { # Directory exists so store it # first on VMS turn []foo into [.foo] for rmtree $fname = VMS::Filespec::vmspath($fname) if $^O eq 'VMS'; push (@dirs_to_unlink, $fname); } else { carp "Request to remove directory $fname could not be completed since it does not exist!\n" if $^W; } } else { if (-f $fname) { # file exists so store handle and name for later removal push(@files_to_unlink, [$fh, $fname]); } else { carp "Request to remove file $fname could not be completed since it is not there!\n" if $^W; } } } } #line 978 sub tempfile { # Can not check for argument count since we can have any # number of args # Default options my %options = ( "DIR" => undef, # Directory prefix "SUFFIX" => '', # Template suffix "UNLINK" => 0, # Do not unlink file on exit "OPEN" => 1, # Open file ); # Check to see whether we have an odd or even number of arguments my $template = (scalar(@_) % 2 == 1 ? shift(@_) : undef); # Read the options and merge with defaults %options = (%options, @_) if @_; # First decision is whether or not to open the file if (! $options{"OPEN"}) { warn "tempfile(): temporary filename requested but not opened.\nPossibly unsafe, consider using tempfile() with OPEN set to true\n" if $^W; } if ($options{"DIR"} and $^O eq 'VMS') { # on VMS turn []foo into [.foo] for concatenation $options{"DIR"} = VMS::Filespec::vmspath($options{"DIR"}); } # Construct the template # Have a choice of trying to work around the mkstemp/mktemp/tmpnam etc # functions or simply constructing a template and using _gettemp() # explicitly. Go for the latter # First generate a template if not defined and prefix the directory # If no template must prefix the temp directory if (defined $template) { if ($options{"DIR"}) { $template = File::Spec->catfile($options{"DIR"}, $template); } } else { if ($options{"DIR"}) { $template = File::Spec->catfile($options{"DIR"}, TEMPXXX); } else { $template = File::Spec->catfile(File::Spec->tmpdir, TEMPXXX); } } # Now add a suffix $template .= $options{"SUFFIX"}; # Determine whether we should tell _gettemp to unlink the file # On unix this is irrelevant and can be worked out after the file is # opened (simply by unlinking the open filehandle). On Windows or VMS # we have to indicate temporary-ness when we open the file. In general # we only want a true temporary file if we are returning just the # filehandle - if the user wants the filename they probably do not # want the file to disappear as soon as they close it. # For this reason, tie unlink_on_close to the return context regardless # of OS. my $unlink_on_close = ( wantarray ? 0 : 1); # Create the file my ($fh, $path, $errstr); croak "Error in tempfile() using $template: $errstr" unless (($fh, $path) = _gettemp($template, "open" => $options{'OPEN'}, "mkdir"=> 0 , "unlink_on_close" => $unlink_on_close, "suffixlen" => length($options{'SUFFIX'}), "ErrStr" => \$errstr, ) ); # Set up an exit handler that can do whatever is right for the # system. This removes files at exit when requested explicitly or when # system is asked to unlink_on_close but is unable to do so because # of OS limitations. # The latter should be achieved by using a tied filehandle. # Do not check return status since this is all done with END blocks. _deferred_unlink($fh, $path, 0) if $options{"UNLINK"}; # Return if (wantarray()) { if ($options{'OPEN'}) { return ($fh, $path); } else { return (undef, $path); } } else { # Unlink the file. It is up to unlink0 to decide what to do with # this (whether to unlink now or to defer until later) unlink0($fh, $path) or croak "Error unlinking file $path using unlink0"; # Return just the filehandle. return $fh; } } #line 1148 # ' sub tempdir { # Can not check for argument count since we can have any # number of args # Default options my %options = ( "CLEANUP" => 0, # Remove directory on exit "DIR" => '', # Root directory "TMPDIR" => 0, # Use tempdir with template ); # Check to see whether we have an odd or even number of arguments my $template = (scalar(@_) % 2 == 1 ? shift(@_) : undef ); # Read the options and merge with defaults %options = (%options, @_) if @_; # Modify or generate the template # Deal with the DIR and TMPDIR options if (defined $template) { # Need to strip directory path if using DIR or TMPDIR if ($options{'TMPDIR'} || $options{'DIR'}) { # Strip parent directory from the filename # # There is no filename at the end $template = VMS::Filespec::vmspath($template) if $^O eq 'VMS'; my ($volume, $directories, undef) = File::Spec->splitpath( $template, 1); # Last directory is then our template $template = (File::Spec->splitdir($directories))[-1]; # Prepend the supplied directory or temp dir if ($options{"DIR"}) { $template = File::Spec->catdir($options{"DIR"}, $template); } elsif ($options{TMPDIR}) { # Prepend tmpdir $template = File::Spec->catdir(File::Spec->tmpdir, $template); } } } else { if ($options{"DIR"}) { $template = File::Spec->catdir($options{"DIR"}, TEMPXXX); } else { $template = File::Spec->catdir(File::Spec->tmpdir, TEMPXXX); } } # Create the directory my $tempdir; my $suffixlen = 0; if ($^O eq 'VMS') { # dir names can end in delimiters $template =~ m/([\.\]:>]+)$/; $suffixlen = length($1); } if ( ($^O eq 'MacOS') && (substr($template, -1) eq ':') ) { # dir name has a trailing ':' ++$suffixlen; } my $errstr; croak "Error in tempdir() using $template: $errstr" unless ((undef, $tempdir) = _gettemp($template, "open" => 0, "mkdir"=> 1 , "suffixlen" => $suffixlen, "ErrStr" => \$errstr, ) ); # Install exit handler; must be dynamic to get lexical if ( $options{'CLEANUP'} && -d $tempdir) { _deferred_unlink(undef, $tempdir, 1); } # Return the dir name return $tempdir; } #line 1268 sub mkstemp { croak "Usage: mkstemp(template)" if scalar(@_) != 1; my $template = shift; my ($fh, $path, $errstr); croak "Error in mkstemp using $template: $errstr" unless (($fh, $path) = _gettemp($template, "open" => 1, "mkdir"=> 0 , "suffixlen" => 0, "ErrStr" => \$errstr, ) ); if (wantarray()) { return ($fh, $path); } else { return $fh; } } #line 1309 sub mkstemps { croak "Usage: mkstemps(template, suffix)" if scalar(@_) != 2; my $template = shift; my $suffix = shift; $template .= $suffix; my ($fh, $path, $errstr); croak "Error in mkstemps using $template: $errstr" unless (($fh, $path) = _gettemp($template, "open" => 1, "mkdir"=> 0 , "suffixlen" => length($suffix), "ErrStr" => \$errstr, ) ); if (wantarray()) { return ($fh, $path); } else { return $fh; } } #line 1351 #' # for emacs sub mkdtemp { croak "Usage: mkdtemp(template)" if scalar(@_) != 1; my $template = shift; my $suffixlen = 0; if ($^O eq 'VMS') { # dir names can end in delimiters $template =~ m/([\.\]:>]+)$/; $suffixlen = length($1); } if ( ($^O eq 'MacOS') && (substr($template, -1) eq ':') ) { # dir name has a trailing ':' ++$suffixlen; } my ($junk, $tmpdir, $errstr); croak "Error creating temp directory from template $template\: $errstr" unless (($junk, $tmpdir) = _gettemp($template, "open" => 0, "mkdir"=> 1 , "suffixlen" => $suffixlen, "ErrStr" => \$errstr, ) ); return $tmpdir; } #line 1392 sub mktemp { croak "Usage: mktemp(template)" if scalar(@_) != 1; my $template = shift; my ($tmpname, $junk, $errstr); croak "Error getting name to temp file from template $template: $errstr" unless (($junk, $tmpname) = _gettemp($template, "open" => 0, "mkdir"=> 0 , "suffixlen" => 0, "ErrStr" => \$errstr, ) ); return $tmpname; } #line 1452 sub tmpnam { # Retrieve the temporary directory name my $tmpdir = File::Spec->tmpdir; croak "Error temporary directory is not writable" if $tmpdir eq ''; # Use a ten character template and append to tmpdir my $template = File::Spec->catfile($tmpdir, TEMPXXX); if (wantarray() ) { return mkstemp($template); } else { return mktemp($template); } } #line 1486 sub tmpfile { # Simply call tmpnam() in a list context my ($fh, $file) = tmpnam(); # Make sure file is removed when filehandle is closed # This will fail on NFS unlink0($fh, $file) or return undef; return $fh; } #line 1529 sub tempnam { croak 'Usage tempnam($dir, $prefix)' unless scalar(@_) == 2; my ($dir, $prefix) = @_; # Add a string to the prefix $prefix .= 'XXXXXXXX'; # Concatenate the directory to the file my $template = File::Spec->catfile($dir, $prefix); return mktemp($template); } #line 1591 sub unlink0 { croak 'Usage: unlink0(filehandle, filename)' unless scalar(@_) == 2; # Read args my ($fh, $path) = @_; warn "Unlinking $path using unlink0\n" if $DEBUG; # Stat the filehandle my @fh = stat $fh; if ($fh[3] > 1 && $^W) { carp "unlink0: fstat found too many links; SB=@fh" if $^W; } # Stat the path my @path = stat $path; unless (@path) { carp "unlink0: $path is gone already" if $^W; return; } # this is no longer a file, but may be a directory, or worse unless (-f _) { confess "panic: $path is no longer a file: SB=@fh"; } # Do comparison of each member of the array # On WinNT dev and rdev seem to be different # depending on whether it is a file or a handle. # Cannot simply compare all members of the stat return # Select the ones we can use my @okstat = (0..$#fh); # Use all by default if ($^O eq 'MSWin32') { @okstat = (1,2,3,4,5,7,8,9,10); } elsif ($^O eq 'os2') { @okstat = (0, 2..$#fh); } elsif ($^O eq 'VMS') { # device and file ID are sufficient @okstat = (0, 1); } elsif ($^O eq 'dos') { @okstat = (0,2..7,11..$#fh); } # Now compare each entry explicitly by number for (@okstat) { print "Comparing: $_ : $fh[$_] and $path[$_]\n" if $DEBUG; # Use eq rather than == since rdev, blksize, and blocks (6, 11, # and 12) will be '' on platforms that do not support them. This # is fine since we are only comparing integers. unless ($fh[$_] eq $path[$_]) { warn "Did not match $_ element of stat\n" if $DEBUG; return 0; } } # attempt remove the file (does not work on some platforms) if (_can_unlink_opened_file()) { # XXX: do *not* call this on a directory; possible race # resulting in recursive removal croak "unlink0: $path has become a directory!" if -d $path; unlink($path) or return 0; # Stat the filehandle @fh = stat $fh; print "Link count = $fh[3] \n" if $DEBUG; # Make sure that the link count is zero # - Cygwin provides deferred unlinking, however, # on Win9x the link count remains 1 # On NFS the link count may still be 1 but we cant know that # we are on NFS return ( $fh[3] == 0 or $^O eq 'cygwin' ? 1 : 0); } else { _deferred_unlink($fh, $path, 0); return 1; } } #line 1754 { # protect from using the variable itself my $LEVEL = STANDARD; sub safe_level { my $self = shift; if (@_) { my $level = shift; if (($level != STANDARD) && ($level != MEDIUM) && ($level != HIGH)) { carp "safe_level: Specified level ($level) not STANDARD, MEDIUM or HIGH - ignoring\n" if $^W; } else { # Dont allow this on perl 5.005 or earlier if ($] < 5.006 && $level != STANDARD) { # Cant do MEDIUM or HIGH checks croak "Currently requires perl 5.006 or newer to do the safe checks"; } # Check that we are allowed to change level # Silently ignore if we can not. $LEVEL = $level if _can_do_level($level); } } return $LEVEL; } } #line 1801 { my $TopSystemUID = 10; sub top_system_uid { my $self = shift; if (@_) { my $newuid = shift; croak "top_system_uid: UIDs should be numeric" unless $newuid =~ /^\d+$/s; $TopSystemUID = $newuid; } return $TopSystemUID; } } #line 1874 1; FILE 25154f80/List/Util.pm 6#line 1 "/usr/lib/perl5/5.8.0/List/Util.pm" # List::Util.pm # # Copyright (c) 1997-2001 Graham Barr <gbarr@pobox.com>. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. package List::Util; require Exporter; require DynaLoader; our @ISA = qw(Exporter DynaLoader); our @EXPORT_OK = qw(first min max minstr maxstr reduce sum shuffle); our $VERSION = "1.07_00"; our $XS_VERSION = $VERSION; $VERSION = eval $VERSION; bootstrap List::Util $XS_VERSION; 1; __END__ #line 195 FILE 0e3542dc/Scalar/Util.pm a#line 1 "/usr/lib/perl5/5.8.0/Scalar/Util.pm" # Scalar::Util.pm # # Copyright (c) 1997-2001 Graham Barr <gbarr@pobox.com>. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. package Scalar::Util; require Exporter; require List::Util; # List::Util loads the XS our @ISA = qw(Exporter); our @EXPORT_OK = qw(blessed dualvar reftype weaken isweak tainted readonly openhandle); our $VERSION = $List::Util::VERSION; sub openhandle ($) { my $fh = shift; my $rt = reftype($fh) || ''; return defined(fileno($fh)) ? $fh : undef if $rt eq 'IO'; if (reftype(\$fh) eq 'GLOB') { # handle openhandle(*DATA) $fh = \(my $tmp=$fh); } elsif ($rt ne 'GLOB') { return undef; } (tied(*$fh) or defined(fileno($fh))) ? $fh : undef; } 1; __END__ #line 171 FILE 8282b802/SelectSaver.pm #line 1 "/usr/lib/perl5/5.8.0/SelectSaver.pm" package SelectSaver; our $VERSION = '1.00'; #line 36 require 5.000; use Carp; use Symbol; sub new { @_ >= 1 && @_ <= 2 or croak 'usage: new SelectSaver [FILEHANDLE]'; my $fh = select; my $self = bless [$fh], $_[0]; select qualify($_[1], caller) if @_ > 1; $self; } sub DESTROY { my $this = $_[0]; select $$this[0]; } 1; FILE c7548358/Symbol.pm e#line 1 "/usr/lib/perl5/5.8.0/Symbol.pm" package Symbol; #line 72 BEGIN { require 5.005; } require Exporter; @ISA = qw(Exporter); @EXPORT = qw(gensym ungensym qualify qualify_to_ref); @EXPORT_OK = qw(delete_package geniosym); $VERSION = 1.04; my $genpkg = "Symbol::"; my $genseq = 0; my %global = map {$_ => 1} qw(ARGV ARGVOUT ENV INC SIG STDERR STDIN STDOUT); # # Note that we never _copy_ the glob; we just make a ref to it. # If we did copy it, then SVf_FAKE would be set on the copy, and # glob-specific behaviors (e.g. C<*$ref = \&func>) wouldn't work. # sub gensym () { my $name = "GEN" . $genseq++; my $ref = \*{$genpkg . $name}; delete $$genpkg{$name}; $ref; } sub geniosym () { my $sym = gensym(); # force the IO slot to be filled select(select $sym); *$sym{IO}; } sub ungensym ($) {} sub qualify ($;$) { my ($name) = @_; if (!ref($name) && index($name, '::') == -1 && index($name, "'") == -1) { my $pkg; # Global names: special character, "^xyz", or other. if ($name =~ /^(([^a-z])|(\^[a-z_]+))\z/i || $global{$name}) { # RGS 2001-11-05 : translate leading ^X to control-char $name =~ s/^\^([a-z_])/'qq(\c'.$1.')'/eei; $pkg = "main"; } else { $pkg = (@_ > 1) ? $_[1] : caller; } $name = $pkg . "::" . $name; } $name; } sub qualify_to_ref ($;$) { return \*{ qualify $_[0], @_ > 1 ? $_[1] : caller }; } # # of Safe.pm lineage # sub delete_package ($) { my $pkg = shift; # expand to full symbol table name if needed unless ($pkg =~ /^main::.*::$/) { $pkg = "main$pkg" if $pkg =~ /^::/; $pkg = "main::$pkg" unless $pkg =~ /^main::/; $pkg .= '::' unless $pkg =~ /::$/; } my($stem, $leaf) = $pkg =~ m/(.*::)(\w+::)$/; my $stem_symtab = *{$stem}{HASH}; return unless defined $stem_symtab and exists $stem_symtab->{$leaf}; # free all the symbols in the package my $leaf_symtab = *{$stem_symtab->{$leaf}}{HASH}; foreach my $name (keys %$leaf_symtab) { undef *{$pkg . $name}; } # delete the symbol table %$leaf_symtab = (); delete $stem_symtab->{$leaf}; } 1; FILE 15f95aeb/Time/Local.pm #line 1 "/usr/lib/perl5/5.8.0/Time/Local.pm" package Time::Local; use 5.006; require Exporter; use Carp; use Config; use strict; use integer; our $VERSION = '1.04'; our @ISA = qw( Exporter ); our @EXPORT = qw( timegm timelocal ); our @EXPORT_OK = qw( timegm_nocheck timelocal_nocheck ); my @MonthDays = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); # Determine breakpoint for rolling century my $ThisYear = (localtime())[5]; my $Breakpoint = ($ThisYear + 50) % 100; my $NextCentury = $ThisYear - $ThisYear % 100; $NextCentury += 100 if $Breakpoint < 50; my $Century = $NextCentury - 100; my $SecOff = 0; my (%Options, %Cheat); my $MaxInt = ((1<<(8 * $Config{intsize} - 2))-1)*2 + 1; my $MaxDay = int(($MaxInt-43200)/86400)-1; # Determine the EPOC day for this machine my $Epoc = 0; if ($^O eq 'vos') { # work around posix-977 -- VOS doesn't handle dates in # the range 1970-1980. $Epoc = _daygm((0, 0, 0, 1, 0, 70, 4, 0)); } elsif ($^O eq 'MacOS') { no integer; $MaxDay *=2 if $^O eq 'MacOS'; # time_t unsigned ... quick hack? # MacOS time() is seconds since 1 Jan 1904, localtime # so we need to calculate an offset to apply later $Epoc = 693901; $SecOff = timelocal(localtime(0)) - timelocal(gmtime(0)); $Epoc += _daygm(gmtime(0)); } else { $Epoc = _daygm(gmtime(0)); } %Cheat=(); # clear the cache as epoc has changed sub _daygm { $_[3] + ($Cheat{pack("ss",@_[4,5])} ||= do { my $month = ($_[4] + 10) % 12; my $year = $_[5] + 1900 - $month/10; 365*$year + $year/4 - $year/100 + $year/400 + ($month*306 + 5)/10 - $Epoc }); } sub _timegm { my $sec = $SecOff + $_[0] + 60 * $_[1] + 3600 * $_[2]; no integer; $sec + 86400 * &_daygm; } sub timegm { my ($sec,$min,$hour,$mday,$month,$year) = @_; if ($year >= 1000) { $year -= 1900; } elsif ($year < 100 and $year >= 0) { $year += ($year > $Breakpoint) ? $Century : $NextCentury; } unless ($Options{no_range_check}) { if (abs($year) >= 0x7fff) { $year += 1900; croak "Cannot handle date ($sec, $min, $hour, $mday, $month, $year)"; } croak "Month '$month' out of range 0..11" if $month > 11 or $month < 0; my $md = $MonthDays[$month]; ++$md unless $month != 1 or $year % 4 or !($year % 400); croak "Day '$mday' out of range 1..$md" if $mday > $md or $mday < 1; croak "Hour '$hour' out of range 0..23" if $hour > 23 or $hour < 0; croak "Minute '$min' out of range 0..59" if $min > 59 or $min < 0; croak "Second '$sec' out of range 0..59" if $sec > 59 or $sec < 0; } my $days = _daygm(undef, undef, undef, $mday, $month, $year); unless ($Options{no_range_check} or abs($days) < $MaxDay) { $year += 1900; croak "Cannot handle date ($sec, $min, $hour, $mday, $month, $year)"; } $sec += $SecOff + 60*$min + 3600*$hour; no integer; $sec + 86400*$days; } sub timegm_nocheck { local $Options{no_range_check} = 1; &timegm; } sub timelocal { no integer; my $ref_t = &timegm; my $loc_t = _timegm(localtime($ref_t)); # Is there a timezone offset from GMT or are we done my $zone_off = $ref_t - $loc_t or return $loc_t; # Adjust for timezone $loc_t = $ref_t + $zone_off; # Are we close to a DST change or are we done my $dst_off = $ref_t - _timegm(localtime($loc_t)) or return $loc_t; # Adjust for DST change $loc_t + $dst_off; } sub timelocal_nocheck { local $Options{no_range_check} = 1; &timelocal; } 1; __END__ #line 255 FILE ebcd47c1/base.pm w#line 1 "/usr/lib/perl5/5.8.0/base.pm" #line 44 package base; use 5.006_001; our $VERSION = "1.03"; sub import { my $class = shift; my $fields_base; my $pkg = caller(0); foreach my $base (@_) { next if $pkg->isa($base); my $vglob; if ($vglob = ${"$base\::"}{VERSION} and *$vglob{SCALAR}) { $$vglob = "-1, set by base.pm" unless defined $$vglob; } else { eval "require $base"; # Only ignore "Can't locate" errors from our eval require. # Other fatal errors (syntax etc) must be reported. die if $@ && $@ !~ /^Can't locate .*? at \(eval /; unless (%{"$base\::"}) { require Carp; Carp::croak("Base class package \"$base\" is empty.\n", "\t(Perhaps you need to 'use' the module ", "which defines that package first.)"); } ${"$base\::VERSION"} = "-1, set by base.pm" unless defined ${"$base\::VERSION"}; } push @{"$pkg\::ISA"}, $base; # A simple test like (defined %{"$base\::FIELDS"}) will # sometimes produce typo warnings because it would create # the hash if it was not present before. my $fglob; if ($fglob = ${"$base\::"}{"FIELDS"} and *$fglob{HASH}) { if ($fields_base) { require Carp; Carp::croak("Can't multiply inherit %FIELDS"); } else { $fields_base = $base; } } } if ($fields_base) { require fields; fields::inherit($pkg, $fields_base); } } 1; FILE 0036d0fa/bytes.pm ;#line 1 "/usr/lib/perl5/5.8.0/bytes.pm" package bytes; our $VERSION = '1.00'; $bytes::hint_bits = 0x00000008; sub import { $^H |= $bytes::hint_bits; } sub unimport { $^H &= ~$bytes::hint_bits; } sub AUTOLOAD { require "bytes_heavy.pl"; goto &$AUTOLOAD; } sub length ($); 1; __END__ #line 69 FILE 78260289/constant.pm #line 1 "/usr/lib/perl5/5.8.0/constant.pm" package constant; use strict; use 5.006_00; use warnings::register; our($VERSION, %declared); $VERSION = '1.04'; #======================================================================= # Some names are evil choices. my %keywords = map +($_, 1), qw{ BEGIN INIT CHECK END DESTROY AUTOLOAD }; my %forced_into_main = map +($_, 1), qw{ STDIN STDOUT STDERR ARGV ARGVOUT ENV INC SIG }; my %forbidden = (%keywords, %forced_into_main); #======================================================================= # import() - import symbols into user's namespace # # What we actually do is define a function in the caller's namespace # which returns the value. The function we create will normally # be inlined as a constant, thereby avoiding further sub calling # overhead. #======================================================================= sub import { my $class = shift; return unless @_; # Ignore 'use constant;' my %constants = (); my $multiple = ref $_[0]; if ( $multiple ) { if (ref $_[0] ne 'HASH') { require Carp; Carp::croak("Invalid reference type '".ref(shift)."' not 'HASH'"); } %constants = %{+shift}; } else { $constants{+shift} = undef; } foreach my $name ( keys %constants ) { unless (defined $name) { require Carp; Carp::croak("Can't use undef as constant name"); } my $pkg = caller; # Normal constant name if ($name =~ /^_?[^\W_0-9]\w*\z/ and !$forbidden{$name}) { # Everything is okay # Name forced into main, but we're not in main. Fatal. } elsif ($forced_into_main{$name} and $pkg ne 'main') { require Carp; Carp::croak("Constant name '$name' is forced into main::"); # Starts with double underscore. Fatal. } elsif ($name =~ /^__/) { require Carp; Carp::croak("Constant name '$name' begins with '__'"); # Maybe the name is tolerable } elsif ($name =~ /^[A-Za-z_]\w*\z/) { # Then we'll warn only if you've asked for warnings if (warnings::enabled()) { if ($keywords{$name}) { warnings::warn("Constant name '$name' is a Perl keyword"); } elsif ($forced_into_main{$name}) { warnings::warn("Constant name '$name' is " . "forced into package main::"); } else { # Catch-all - what did I miss? If you get this error, # please let me know what your constant's name was. # Write to <rootbeer@redcat.com>. Thanks! warnings::warn("Constant name '$name' has unknown problems"); } } # Looks like a boolean # use constant FRED == fred; } elsif ($name =~ /^[01]?\z/) { require Carp; if (@_) { Carp::croak("Constant name '$name' is invalid"); } else { Carp::croak("Constant name looks like boolean value"); } } else { # Must have bad characters require Carp; Carp::croak("Constant name '$name' has invalid characters"); } { no strict 'refs'; my $full_name = "${pkg}::$name"; $declared{$full_name}++; if ($multiple) { my $scalar = $constants{$name}; *$full_name = sub () { $scalar }; } else { if (@_ == 1) { my $scalar = $_[0]; *$full_name = sub () { $scalar }; } elsif (@_) { my @list = @_; *$full_name = sub () { @list }; } else { *$full_name = sub () { }; } } } } } 1; __END__ #line 346 FILE 9fa6541c/Config.pm #line 1 "/usr/lib/perl5/5.8.0/i386-linux-thread-multi/Config.pm" package Config; use Exporter (); @EXPORT = qw(%Config); @EXPORT_OK = qw(myconfig config_sh config_vars); # Define our own import method to avoid pulling in the full Exporter: sub import { my $pkg = shift; @_ = @EXPORT unless @_; my @func = grep {$_ ne '%Config'} @_; local $Exporter::ExportLevel = 1; Exporter::import('Config', @func) if @func; return if @func == @_; my $callpkg = caller(0); *{"$callpkg\::Config"} = \%Config; } die "Perl lib version (v5.8.0) doesn't match executable version ($])" unless $^V; $^V eq v5.8.0 or die "Perl lib version (v5.8.0) doesn't match executable version (" . (sprintf "v%vd",$^V) . ")"; # This file was created by configpm when Perl was built. Any changes # made to this file will be lost the next time perl is built. ## ## This file was produced by running the Configure script. It holds all the ## definitions figured out by Configure. Should you modify one of these values, ## do not forget to propagate your changes by running "Configure -der". You may ## instead choose to run each of the .SH files by yourself, or "Configure -S". ## # ## Package name : perl5 ## Source directory : . ## Configuration time: Sun Sep 1 23:55:07 EDT 2002 ## Configured by : bhcompile ## Target system : linux daffy.perf.redhat.com 2.4.18-11smp #1 smp thu aug 15 06:41:59 edt 2002 i686 i686 i386 gnulinux # ## Configure command line arguments. #PERL_PATCHLEVEL= my $config_sh = <<'!END!'; archlibexp='/usr/lib/perl5/5.8.0/i386-linux-thread-multi' archname='i386-linux-thread-multi' cc='gcc' ccflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm' cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -I/usr/include/gdbm' dlsrc='dl_dlopen.xs' dynamic_ext='B ByteLoader Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Encode Fcntl File/Glob Filter/Util/Call GDBM_File I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Time/HiRes Unicode/Normalize XS/APItest XS/Typemap attrs re threads threads/shared' extensions='B ByteLoader Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Encode Fcntl File/Glob Filter/Util/Call GDBM_File I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Time/HiRes Unicode/Normalize XS/APItest XS/Typemap attrs re threads threads/shared Errno' installarchlib='/usr/lib/perl5/5.8.0/i386-linux-thread-multi' installprivlib='/usr/lib/perl5/5.8.0' libpth='/usr/local/lib /lib /usr/lib' libs='-lnsl -lgdbm -ldb -ldl -lm -lpthread -lc -lcrypt -lutil' osname='linux' osvers='2.4.18-11smp' prefix='/usr' privlibexp='/usr/lib/perl5/5.8.0' sharpbang='#!' shsharp='true' sig_name='ZERO HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS NUM32 NUM33 NUM34 RTMIN NUM36 NUM37 NUM38 NUM39 NUM40 NUM41 NUM42 NUM43 NUM44 NUM45 NUM46 NUM47 NUM48 NUM49 NUM50 NUM51 NUM52 NUM53 NUM54 NUM55 NUM56 NUM57 NUM58 NUM59 NUM60 NUM61 NUM62 RTMAX IOT CLD POLL UNUSED ' sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 6 17 29 31 ' so='so' startsh='#!/bin/sh' static_ext=' ' Author='' CONFIG='true' Date='$Date' Header='' Id='$Id' Locker='' Log='$Log' Mcc='Mcc' PATCHLEVEL='8' PERL_API_REVISION='5' PERL_API_SUBVERSION='0' PERL_API_VERSION='8' PERL_CONFIG_SH='true' PERL_REVISION='5' PERL_SUBVERSION='0' PERL_VERSION='8' RCSfile='$RCSfile' Revision='$Revision' SUBVERSION='0' Source='' State='' _a='.a' _exe='' _o='.o' afs='false' afsroot='/afs' alignbytes='4' ansi2knr='' aphostname='' api_revision='5' api_subversion='0' api_version='8' api_versionstring='5.8.0' ar='ar' archlib='/usr/lib/perl5/5.8.0/i386-linux-thread-multi' archname64='' archobjs='' asctime_r_proto='REENTRANT_PROTO_B_SB' awk='awk' baserev='5.0' bash='' bin='/usr/bin' binexp='/usr/bin' bison='bison' byacc='byacc' byteorder='1234' c='' castflags='0' cat='cat' cccdlflags='-fpic' ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE' ccflags_uselargefiles='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' ccname='gcc' ccsymbols='__GNUC_MINOR__=2 __GNUC_PATCHLEVEL__=0 __GXX_ABI_VERSION=102 __NO_INLINE__=1 __STDC_HOSTED__=1 __gnu_linux__=1 __i386=1 __i386__=1 __linux=1 __linux__=1 __tune_i386__=1 __unix=1 __unix__=1 cpu=i386 machine=i386 system=posix' ccversion='' cf_by='bhcompile' cf_email='bhcompile@localhost.localdomain' cf_time='Sun Sep 1 23:55:07 EDT 2002' charsize='1' chgrp='' chmod='chmod' chown='' clocktype='clock_t' comm='comm' compress='' config_arg0='Configure' config_arg10='-Dvendorprefix=/usr' config_arg11='-Dsiteprefix=/usr' config_arg12='-Duseshrplib' config_arg13='-Dusethreads' config_arg14='-Duseithreads' config_arg15='-Duselargefiles' config_arg16='-Dd_dosuid' config_arg17='-Dd_semctl_semun' config_arg18='-Di_db' config_arg19='-Ui_ndbm' config_arg1='-des' config_arg20='-Di_gdbm' config_arg21='-Di_shadow' config_arg22='-Di_syslog' config_arg23='-Dman3ext=3pm' config_arg24='-Duseperlio' config_arg25='-Dinstallusrbinperl' config_arg26='-Ubincompat5005' config_arg27='-Uversiononly' config_arg28='-Dpager=/usr/bin/less -isr' config_arg2='-Doptimize=-O2 -march=i386 -mcpu=i686' config_arg3='-Dmyhostname=localhost' config_arg4='-Dperladmin=root@localhost' config_arg5='-Dcc=gcc' config_arg6='-Dcf_by=Red Hat, Inc.' config_arg7='-Dinstallprefix=/usr' config_arg8='-Dprefix=/usr' config_arg9='-Darchname=i386-linux' config_argc='28' config_args='-des -Doptimize=-O2 -march=i386 -mcpu=i686 -Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux -Dvendorprefix=/usr -Dsiteprefix=/usr -Duseshrplib -Dusethreads -Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr' contains='grep' cp='cp' cpio='' cpp='cpp' cpp_stuff='42' cppccsymbols='__ELF__=1 __GNUC__=3 i386=1 linux=1 unix=1' cpplast='-' cppminus='-' cpprun='gcc -E' cppstdin='gcc -E' cppsymbols='_FILE_OFFSET_BITS=64 __GLIBC__=2 __GLIBC_MINOR__=3 __GNUC_MINOR__=2 __GNU_LIBRARY__=6 _GNU_SOURCE=1 _LARGEFILE64_SOURCE=1 _LARGEFILE_SOURCE=1 _POSIX_C_SOURCE=199506 _POSIX_SOURCE=1 _REENTRANT=1 __STDC__=1 __USE_BSD=1 __USE_FILE_OFFSET64=1 __USE_GNU=1 __USE_LARGEFILE=1 __USE_LARGEFILE64=1 __USE_MISC=1 __USE_POSIX=1 __USE_POSIX199309=1 __USE_POSIX199506=1 __USE_POSIX2=1 __USE_REENTRANT=1 __USE_SVID=1 __USE_UNIX98=1 __USE_XOPEN=1 __USE_XOPEN_EXTENDED=1 _XOPEN_SOURCE=600 _XOPEN_SOURCE_EXTENDED=1 __i386=1 __i386__=1 __linux=1 __linux__=1 __unix=1 __unix__=1' crypt_r_proto='REENTRANT_PROTO_B_CCS' cryptlib='' csh='csh' ctermid_r_proto='0' ctime_r_proto='REENTRANT_PROTO_B_SB' d_Gconvert='gcvt((x),(n),(b))' d_PRIEUldbl='define' d_PRIFUldbl='define' d_PRIGUldbl='define' d_PRIXU64='define' d_PRId64='define' d_PRIeldbl='define' d_PRIfldbl='define' d_PRIgldbl='define' d_PRIi64='define' d_PRIo64='define' d_PRIu64='define' d_PRIx64='define' d_SCNfldbl='define' d__fwalk='undef' d_access='define' d_accessx='undef' d_alarm='define' d_archlib='define' d_asctime_r='define' d_atolf='undef' d_atoll='define' d_attribut='define' d_bcmp='define' d_bcopy='define' d_bsd='undef' d_bsdgetpgrp='undef' d_bsdsetpgrp='undef' d_bzero='define' d_casti32='undef' d_castneg='define' d_charvspr='undef' d_chown='define' d_chroot='define' d_chsize='undef' d_class='undef' d_closedir='define' d_cmsghdr_s='define' d_const='define' d_crypt='define' d_crypt_r='define' d_csh='define' d_ctermid_r='undef' d_ctime_r='define' d_cuserid='define' d_dbl_dig='define' d_dbminitproto='undef' d_difftime='define' d_dirfd='define' d_dirnamlen='undef' d_dlerror='define' d_dlopen='define' d_dlsymun='undef' d_dosuid='define' d_drand48_r='define' d_drand48proto='define' d_dup2='define' d_eaccess='undef' d_endgrent='define' d_endgrent_r='undef' d_endhent='define' d_endhostent_r='undef' d_endnent='define' d_endnetent_r='undef' d_endpent='define' d_endprotoent_r='undef' d_endpwent='define' d_endpwent_r='undef' d_endsent='define' d_endservent_r='undef' d_eofnblk='define' d_eunice='undef' d_fchdir='define' d_fchmod='define' d_fchown='define' d_fcntl='define' d_fcntl_can_lock='define' d_fd_macros='define' d_fd_set='define' d_fds_bits='define' d_fgetpos='define' d_finite='define' d_finitel='define' d_flexfnam='define' d_flock='define' d_flockproto='define' d_fork='define' d_fp_class='undef' d_fpathconf='define' d_fpclass='undef' d_fpclassify='undef' d_fpclassl='undef' d_fpos64_t='undef' d_frexpl='define' d_fs_data_s='undef' d_fseeko='define' d_fsetpos='define' d_fstatfs='define' d_fstatvfs='define' d_fsync='define' d_ftello='define' d_ftime='undef' d_getcwd='define' d_getespwnam='undef' d_getfsstat='undef' d_getgrent='define' d_getgrent_r='define' d_getgrgid_r='define' d_getgrnam_r='define' d_getgrps='define' d_gethbyaddr='define' d_gethbyname='define' d_gethent='define' d_gethname='define' d_gethostbyaddr_r='undef' d_gethostbyname_r='define' d_gethostent_r='define' d_gethostprotos='define' d_getitimer='define' d_getlogin='define' d_getlogin_r='define' d_getmnt='undef' d_getmntent='define' d_getnbyaddr='define' d_getnbyname='define' d_getnent='define' d_getnetbyaddr_r='undef' d_getnetbyname_r='define' d_getnetent_r='define' d_getnetprotos='define' d_getpagsz='define' d_getpbyname='define' d_getpbynumber='define' d_getpent='define' d_getpgid='define' d_getpgrp2='undef' d_getpgrp='define' d_getppid='define' d_getprior='define' d_getprotobyname_r='define' d_getprotobynumber_r='define' d_getprotoent_r='define' d_getprotoprotos='define' d_getprpwnam='undef' d_getpwent='define' d_getpwent_r='define' d_getpwnam_r='define' d_getpwuid_r='define' d_getsbyname='define' d_getsbyport='define' d_getsent='define' d_getservbyname_r='define' d_getservbyport_r='define' d_getservent_r='define' d_getservprotos='define' d_getspnam='define' d_getspnam_r='define' d_gettimeod='define' d_gmtime_r='define' d_gnulibc='define' d_grpasswd='define' d_hasmntopt='define' d_htonl='define' d_index='undef' d_inetaton='define' d_int64_t='define' d_isascii='define' d_isfinite='undef' d_isinf='define' d_isnan='define' d_isnanl='define' d_killpg='define' d_lchown='define' d_ldbl_dig='define' d_link='define' d_localtime_r='define' d_locconv='define' d_lockf='define' d_longdbl='define' d_longlong='define' d_lseekproto='define' d_lstat='define' d_madvise='define' d_mblen='define' d_mbstowcs='define' d_mbtowc='define' d_memchr='define' d_memcmp='define' d_memcpy='define' d_memmove='define' d_memset='define' d_mkdir='define' d_mkdtemp='define' d_mkfifo='define' d_mkstemp='define' d_mkstemps='undef' d_mktime='define' d_mmap='define' d_modfl='define' d_modfl_pow32_bug='undef' d_mprotect='define' d_msg='define' d_msg_ctrunc='define' d_msg_dontroute='define' d_msg_oob='define' d_msg_peek='define' d_msg_proxy='define' d_msgctl='define' d_msgget='define' d_msghdr_s='define' d_msgrcv='define' d_msgsnd='define' d_msync='define' d_munmap='define' d_mymalloc='undef' d_nice='define' d_nl_langinfo='define' d_nv_preserves_uv='define' d_off64_t='define' d_old_pthread_create_joinable='undef' d_oldpthreads='undef' d_oldsock='undef' d_open3='define' d_pathconf='define' d_pause='define' d_perl_otherlibdirs='undef' d_phostname='undef' d_pipe='define' d_poll='define' d_portable='define' d_procselfexe='define' d_pthread_atfork='define' d_pthread_yield='define' d_pwage='undef' d_pwchange='undef' d_pwclass='undef' d_pwcomment='undef' d_pwexpire='undef' d_pwgecos='define' d_pwpasswd='define' d_pwquota='undef' d_qgcvt='define' d_quad='define' d_random_r='undef' d_readdir64_r='define' d_readdir='define' d_readdir_r='define' d_readlink='define' d_readv='define' d_recvmsg='define' d_rename='define' d_rewinddir='define' d_rmdir='define' d_safebcpy='undef' d_safemcpy='undef' d_sanemcmp='define' d_sbrkproto='define' d_sched_yield='define' d_scm_rights='define' d_seekdir='define' d_select='define' d_sem='define' d_semctl='define' d_semctl_semid_ds='define' d_semctl_semun='define' d_semget='define' d_semop='define' d_sendmsg='define' d_setegid='define' d_seteuid='define' d_setgrent='define' d_setgrent_r='undef' d_setgrps='define' d_sethent='define' d_sethostent_r='undef' d_setitimer='define' d_setlinebuf='define' d_setlocale='define' d_setlocale_r='undef' d_setnent='define' d_setnetent_r='undef' d_setpent='define' d_setpgid='define' d_setpgrp2='undef' d_setpgrp='define' d_setprior='define' d_setproctitle='undef' d_setprotoent_r='undef' d_setpwent='define' d_setpwent_r='undef' d_setregid='define' d_setresgid='define' d_setresuid='define' d_setreuid='define' d_setrgid='undef' d_setruid='undef' d_setsent='define' d_setservent_r='undef' d_setsid='define' d_setvbuf='define' d_sfio='undef' d_shm='define' d_shmat='define' d_shmatprototype='define' d_shmctl='define' d_shmdt='define' d_shmget='define' d_sigaction='define' d_sigprocmask='define' d_sigsetjmp='define' d_sockatmark='define' d_sockatmarkproto='define' d_socket='define' d_socklen_t='define' d_sockpair='define' d_socks5_init='undef' d_sqrtl='define' d_srand48_r='define' d_srandom_r='define' d_sresgproto='undef' d_sresuproto='undef' d_statblks='define' d_statfs_f_flags='undef' d_statfs_s='define' d_statvfs='define' d_stdio_cnt_lval='undef' d_stdio_ptr_lval='undef' d_stdio_ptr_lval_nochange_cnt='undef' d_stdio_ptr_lval_sets_cnt='undef' d_stdio_stream_array='undef' d_stdiobase='undef' d_stdstdio='undef' d_strchr='define' d_strcoll='define' d_strctcpy='define' d_strerrm='strerror(e)' d_strerror='define' d_strerror_r='define' d_strftime='define' d_strtod='define' d_strtol='define' d_strtold='define' d_strtoll='define' d_strtoq='define' d_strtoul='define' d_strtoull='define' d_strtouq='define' d_strxfrm='define' d_suidsafe='undef' d_symlink='define' d_syscall='define' d_syscallproto='define' d_sysconf='define' d_sysernlst='' d_syserrlst='define' d_system='define' d_tcgetpgrp='define' d_tcsetpgrp='define' d_telldir='define' d_telldirproto='define' d_time='define' d_times='define' d_tm_tm_gmtoff='define' d_tm_tm_zone='define' d_tmpnam_r='define' d_truncate='define' d_ttyname_r='define' d_tzname='define' d_u32align='define' d_ualarm='define' d_umask='define' d_uname='define' d_union_semun='undef' d_unordered='undef' d_usleep='define' d_usleepproto='define' d_ustat='define' d_vendorarch='define' d_vendorbin='define' d_vendorlib='define' d_vfork='undef' d_void_closedir='undef' d_voidsig='define' d_voidtty='' d_volatile='define' d_vprintf='define' d_wait4='define' d_waitpid='define' d_wcstombs='define' d_wctomb='define' d_writev='define' d_xenix='undef' date='date' db_hashtype='u_int32_t' db_prefixtype='size_t' db_version_major='4' db_version_minor='0' db_version_patch='14' defvoidused='15' direntrytype='struct dirent' dlext='so' doublesize='8' drand01='drand48()' drand48_r_proto='REENTRANT_PROTO_I_ST' eagain='EAGAIN' ebcdic='undef' echo='echo' egrep='egrep' emacs='' endgrent_r_proto='0' endhostent_r_proto='0' endnetent_r_proto='0' endprotoent_r_proto='0' endpwent_r_proto='0' endservent_r_proto='0' eunicefix=':' exe_ext='' expr='expr' extras='' fflushNULL='define' fflushall='undef' find='' firstmakefile='makefile' flex='' fpossize='16' fpostype='fpos_t' freetype='void' from=':' full_ar='/usr/bin/ar' full_csh='/bin/csh' full_sed='/bin/sed' gccosandvers='' gccversion='3.2 20020822 (Red Hat Linux Rawhide 3.2-5)' getgrent_r_proto='REENTRANT_PROTO_I_SBWR' getgrgid_r_proto='REENTRANT_PROTO_I_TSBWR' getgrnam_r_proto='REENTRANT_PROTO_I_CSBWR' gethostbyaddr_r_proto='0' gethostbyname_r_proto='REENTRANT_PROTO_I_CSBWRE' gethostent_r_proto='REENTRANT_PROTO_I_SBWRE' getlogin_r_proto='REENTRANT_PROTO_I_BW' getnetbyaddr_r_proto='0' getnetbyname_r_proto='REENTRANT_PROTO_I_CSBWRE' getnetent_r_proto='REENTRANT_PROTO_I_SBWRE' getprotobyname_r_proto='REENTRANT_PROTO_I_CSBWR' getprotobynumber_r_proto='REENTRANT_PROTO_I_ISBWR' getprotoent_r_proto='REENTRANT_PROTO_I_SBWR' getpwent_r_proto='REENTRANT_PROTO_I_SBWR' getpwnam_r_proto='REENTRANT_PROTO_I_CSBWR' getpwuid_r_proto='REENTRANT_PROTO_I_TSBWR' getservbyname_r_proto='REENTRANT_PROTO_I_CCSBWR' getservbyport_r_proto='REENTRANT_PROTO_I_ICSBWR' getservent_r_proto='REENTRANT_PROTO_I_SBWR' getspnam_r_proto='REENTRANT_PROTO_I_CSBWR' gidformat='"lu"' gidsign='1' gidsize='4' gidtype='gid_t' glibpth='/usr/shlib /lib /usr/lib /usr/lib/386 /lib/386 /usr/ccs/lib /usr/ucblib /usr/local/lib ' gmake='gmake' gmtime_r_proto='REENTRANT_PROTO_S_TS' gnulibc_version='2.2.92' grep='grep' groupcat='cat /etc/group' groupstype='gid_t' gzip='gzip' h_fcntl='false' h_sysfile='true' hint='recommended' hostcat='cat /etc/hosts' i16size='2' i16type='short' i32size='4' i32type='long' i64size='8' i64type='long long' i8size='1' i8type='char' i_arpainet='define' i_bsdioctl='' i_crypt='define' i_db='define' i_dbm='undef' i_dirent='define' i_dld='undef' i_dlfcn='define' i_fcntl='undef' i_float='define' i_fp='undef' i_fp_class='undef' i_gdbm='define' i_grp='define' i_ieeefp='undef' i_inttypes='define' i_langinfo='define' i_libutil='undef' i_limits='define' i_locale='define' i_machcthr='undef' i_malloc='define' i_math='define' i_memory='undef' i_mntent='define' i_ndbm='undef' i_netdb='define' i_neterrno='undef' i_netinettcp='define' i_niin='define' i_poll='define' i_prot='undef' i_pthread='define' i_pwd='define' i_rpcsvcdbm='undef' i_sfio='undef' i_sgtty='undef' i_shadow='define' i_socks='undef' i_stdarg='define' i_stddef='define' i_stdlib='define' i_string='define' i_sunmath='undef' i_sysaccess='undef' i_sysdir='define' i_sysfile='define' i_sysfilio='undef' i_sysin='undef' i_sysioctl='define' i_syslog='define' i_sysmman='define' i_sysmode='undef' i_sysmount='define' i_sysndir='undef' i_sysparam='define' i_sysresrc='define' i_syssecrt='undef' i_sysselct='define' i_syssockio='undef' i_sysstat='define' i_sysstatfs='define' i_sysstatvfs='define' i_systime='define' i_systimek='undef' i_systimes='define' i_systypes='define' i_sysuio='define' i_sysun='define' i_sysutsname='define' i_sysvfs='define' i_syswait='define' i_termio='undef' i_termios='define' i_time='define' i_unistd='define' i_ustat='define' i_utime='define' i_values='define' i_varargs='undef' i_varhdr='stdarg.h' i_vfork='undef' ignore_versioned_solibs='y' inc_version_list='5.6.1' inc_version_list_init='"5.6.1",0' incpath='' inews='' installbin='/usr/bin' installman1dir='/usr/share/man/man1' installman3dir='/usr/share/man/man3' installprefix='/usr' installprefixexp='/usr' installscript='/usr/bin' installsitearch='/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi' installsitebin='/usr/bin' installsitelib='/usr/lib/perl5/site_perl/5.8.0' installstyle='lib/perl5' installusrbinperl='define' installvendorarch='/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi' installvendorbin='/usr/bin' installvendorlib='/usr/lib/perl5/vendor_perl/5.8.0' intsize='4' issymlink='/usr/bin/test -h' ivdformat='"ld"' ivsize='4' ivtype='long' known_extensions='B ByteLoader Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Encode Fcntl File/Glob Filter/Util/Call GDBM_File I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 NDBM_File ODBM_File Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Thread Time/HiRes Unicode/Normalize XS/APItest XS/Typemap attrs re threads threads/shared' ksh='' ld='gcc' lddlflags='-shared -L/usr/local/lib' ldflags=' -L/usr/local/lib' ldflags_uselargefiles='' ldlibpthname='LD_LIBRARY_PATH' less='less' lib_ext='.a' libc='/lib/libc-2.2.92.so' libperl='libperl.so' libsdirs=' /usr/lib /lib' libsfiles=' libnsl.so libgdbm.so libdb.so libdl.so libm.so libpthread.so libc.so libcrypt.so libutil.so' libsfound=' /usr/lib/libnsl.so /usr/lib/libgdbm.so /lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libpthread.so /usr/lib/libc.so /usr/lib/libcrypt.so /usr/lib/libutil.so' libspath=' /usr/local/lib /lib /usr/lib' libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m pthread c cposix posix ndir dir crypt sec ucb BSD PW x util' libswanted_uselargefiles='' line='' lint='' lkflags='' ln='ln' lns='/bin/ln -s' localtime_r_proto='REENTRANT_PROTO_S_TS' locincpth='/opt/local/include /usr/gnu/include /opt/gnu/include /usr/GNU/include /opt/GNU/include' loclibpth='/usr/local/lib /opt/local/lib /usr/gnu/lib /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib' longdblsize='12' longlongsize='8' longsize='4' lp='' lpr='' ls='ls' lseeksize='8' lseektype='off_t' mail='' mailx='' make='make' make_set_make='#' mallocobj='' mallocsrc='' malloctype='void *' man1dir='/usr/share/man/man1' man1direxp='/usr/share/man/man1' man1ext='1' man3dir='/usr/share/man/man3' man3direxp='/usr/share/man/man3' man3ext='3pm' mips_type='' mkdir='mkdir' mmaptype='void *' modetype='mode_t' more='more' multiarch='undef' mv='' myarchname='i686-linux' mydomain='.localdomain' myhostname='localhost' myuname='linux daffy.perf.redhat.com 2.4.18-11smp #1 smp thu aug 15 06:41:59 edt 2002 i686 i686 i386 gnulinux ' n='-n' need_va_copy='undef' netdb_hlen_type='size_t' netdb_host_type='const void *' netdb_name_type='const char *' netdb_net_type='in_addr_t' nm='nm' nm_opt='' nm_so_opt='--dynamic' nonxs_ext='Errno' nroff='nroff' nvEUformat='"E"' nvFUformat='"F"' nvGUformat='"G"' nv_preserves_uv_bits='32' nveformat='"e"' nvfformat='"f"' nvgformat='"g"' nvsize='8' nvtype='double' o_nonblock='O_NONBLOCK' obj_ext='.o' old_pthread_create_joinable='' optimize='-O2 -march=i386 -mcpu=i686' orderlib='false' otherlibdirs=' ' package='perl5' pager='/usr/bin/less -isr' passcat='cat /etc/passwd' patchlevel='8' path_sep=':' perl5='/usr/bin/perl' perl='' perl_patchlevel='' perladmin='root@localhost' perllibs='-lnsl -ldl -lm -lpthread -lc -lcrypt -lutil' perlpath='/usr/bin/perl' pg='pg' phostname='' pidtype='pid_t' plibpth='' pm_apiversion='5.005' pmake='' pr='' prefixexp='/usr' privlib='/usr/lib/perl5/5.8.0' procselfexe='"/proc/self/exe"' prototype='define' ptrsize='4' quadkind='3' quadtype='long long' randbits='48' randfunc='drand48' random_r_proto='0' randseedtype='long' ranlib=':' rd_nodata='-1' readdir64_r_proto='REENTRANT_PROTO_I_TSR' readdir_r_proto='REENTRANT_PROTO_I_TSR' revision='5' rm='rm' rmail='' run='' runnm='false' sPRIEUldbl='"LE"' sPRIFUldbl='"LF"' sPRIGUldbl='"LG"' sPRIXU64='"LX"' sPRId64='"Ld"' sPRIeldbl='"Le"' sPRIfldbl='"Lf"' sPRIgldbl='"Lg"' sPRIi64='"Li"' sPRIo64='"Lo"' sPRIu64='"Lu"' sPRIx64='"Lx"' sSCNfldbl='"Lf"' sched_yield='sched_yield()' scriptdir='/usr/bin' scriptdirexp='/usr/bin' sed='sed' seedfunc='srand48' selectminbits='32' selecttype='fd_set *' sendmail='' setgrent_r_proto='0' sethostent_r_proto='0' setlocale_r_proto='0' setnetent_r_proto='0' setprotoent_r_proto='0' setpwent_r_proto='0' setservent_r_proto='0' sh='/bin/sh' shar='' shmattype='void *' shortsize='2' shrpenv='' sig_count='64' sig_name_init='"ZERO", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "BUS", "FPE", "KILL", "USR1", "SEGV", "USR2", "PIPE", "ALRM", "TERM", "STKFLT", "CHLD", "CONT", "STOP", "TSTP", "TTIN", "TTOU", "URG", "XCPU", "XFSZ", "VTALRM", "PROF", "WINCH", "IO", "PWR", "SYS", "NUM32", "NUM33", "NUM34", "RTMIN", "NUM36", "NUM37", "NUM38", "NUM39", "NUM40", "NUM41", "NUM42", "NUM43", "NUM44", "NUM45", "NUM46", "NUM47", "NUM48", "NUM49", "NUM50", "NUM51", "NUM52", "NUM53", "NUM54", "NUM55", "NUM56", "NUM57", "NUM58", "NUM59", "NUM60", "NUM61", "NUM62", "RTMAX", "IOT", "CLD", "POLL", "UNUSED", 0' sig_num_init='0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 6, 17, 29, 31, 0' sig_size='68' signal_t='void' sitearch='/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi' sitearchexp='/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi' sitebin='/usr/bin' sitebinexp='/usr/bin' sitelib='/usr/lib/perl5/site_perl/5.8.0' sitelib_stem='/usr/lib/perl5/site_perl' sitelibexp='/usr/lib/perl5/site_perl/5.8.0' siteprefix='/usr' siteprefixexp='/usr' sizesize='4' sizetype='size_t' sleep='' smail='' sockethdr='' socketlib='' socksizetype='socklen_t' sort='sort' spackage='Perl5' spitshell='cat' srand48_r_proto='REENTRANT_PROTO_I_LS' srandom_r_proto='REENTRANT_PROTO_I_TS' src='.' ssizetype='ssize_t' startperl='#!/usr/bin/perl' stdchar='char' stdio_base='((fp)->_IO_read_base)' stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)' stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)' stdio_filbuf='' stdio_ptr='((fp)->_IO_read_ptr)' stdio_stream_array='' strerror_r_proto='REENTRANT_PROTO_B_IBW' strings='/usr/include/string.h' submit='' subversion='0' sysman='/usr/share/man/man1' tail='' tar='' targetarch='' tbl='' tee='' test='test' timeincl='/usr/include/sys/time.h /usr/include/time.h ' timetype='time_t' tmpnam_r_proto='REENTRANT_PROTO_B_B' to=':' touch='touch' tr='tr' trnl='\n' troff='' ttyname_r_proto='REENTRANT_PROTO_I_IBW' u16size='2' u16type='unsigned short' u32size='4' u32type='unsigned long' u64size='8' u64type='unsigned long long' u8size='1' u8type='unsigned char' uidformat='"lu"' uidsign='1' uidsize='4' uidtype='uid_t' uname='uname' uniq='uniq' uquadtype='unsigned long long' use5005threads='undef' use64bitall='undef' use64bitint='undef' usecrosscompile='undef' usedl='define' useithreads='define' uselargefiles='define' uselongdouble='undef' usemorebits='undef' usemultiplicity='define' usemymalloc='n' usenm='false' useopcode='true' useperlio='define' useposix='true' usereentrant='undef' usesfio='false' useshrplib='true' usesocks='undef' usethreads='define' usevendorprefix='define' usevfork='false' usrinc='/usr/include' uuname='' uvXUformat='"lX"' uvoformat='"lo"' uvsize='4' uvtype='unsigned long' uvuformat='"lu"' uvxformat='"lx"' vendorarch='/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi' vendorarchexp='/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi' vendorbin='/usr/bin' vendorbinexp='/usr/bin' vendorlib='/usr/lib/perl5/vendor_perl/5.8.0' vendorlib_stem='/usr/lib/perl5/vendor_perl' vendorlibexp='/usr/lib/perl5/vendor_perl/5.8.0' vendorprefix='/usr' vendorprefixexp='/usr' version='5.8.0' version_patchlevel_string='version 8 subversion 0' versiononly='undef' vi='' voidflags='15' xlibpth='/usr/lib/386 /lib/386' xs_apiversion='5.8.0' yacc='/usr/bin/byacc' yaccflags='' zcat='' zip='zip' !END! my $summary = <<'!END!'; Summary of my $package (revision $baserev $version_patchlevel_string) configuration: Platform: osname=$osname, osvers=$osvers, archname=$archname uname='$myuname' config_args='$config_args' hint=$hint, useposix=$useposix, d_sigaction=$d_sigaction usethreads=$usethreads use5005threads=$use5005threads useithreads=$useithreads usemultiplicity=$usemultiplicity useperlio=$useperlio d_sfio=$d_sfio uselargefiles=$uselargefiles usesocks=$usesocks use64bitint=$use64bitint use64bitall=$use64bitall uselongdouble=$uselongdouble usemymalloc=$usemymalloc, bincompat5005=undef Compiler: cc='$cc', ccflags ='$ccflags', optimize='$optimize', cppflags='$cppflags' ccversion='$ccversion', gccversion='$gccversion', gccosandvers='$gccosandvers' intsize=$intsize, longsize=$longsize, ptrsize=$ptrsize, doublesize=$doublesize, byteorder=$byteorder d_longlong=$d_longlong, longlongsize=$longlongsize, d_longdbl=$d_longdbl, longdblsize=$longdblsize ivtype='$ivtype', ivsize=$ivsize, nvtype='$nvtype', nvsize=$nvsize, Off_t='$lseektype', lseeksize=$lseeksize alignbytes=$alignbytes, prototype=$prototype Linker and Libraries: ld='$ld', ldflags ='$ldflags' libpth=$libpth libs=$libs perllibs=$perllibs libc=$libc, so=$so, useshrplib=$useshrplib, libperl=$libperl gnulibc_version='$gnulibc_version' Dynamic Linking: dlsrc=$dlsrc, dlext=$dlext, d_dlsymun=$d_dlsymun, ccdlflags='$ccdlflags' cccdlflags='$cccdlflags', lddlflags='$lddlflags' !END! my $summary_expanded = 0; sub myconfig { return $summary if $summary_expanded; $summary =~ s{\$(\w+)} { my $c = $Config{$1}; defined($c) ? $c : 'undef' }ge; $summary_expanded = 1; $summary; } sub FETCH { # check for cached value (which may be undef so we use exists not defined) return $_[0]->{$_[1]} if (exists $_[0]->{$_[1]}); # Search for it in the big string my($value, $start, $marker, $quote_type); $quote_type = "'"; # Virtual entries. if ($_[1] eq 'byteorder') { # byteorder does exist on its own but we overlay a virtual # dynamically recomputed value. my $t = $Config{ivtype}; my $s = $Config{ivsize}; my $f = $t eq 'long' ? 'L!' : $s == 8 ? 'Q': 'I'; if ($s == 4 || $s == 8) { my $i = 0; foreach my $c (reverse(2..$s)) { $i |= ord($c); $i <<= 8 } $i |= ord(1); $value = join('', unpack('a'x$s, pack($f, $i))); } else { $value = '?'x$s; } } elsif ($_[1] =~ /^((?:cc|ld)flags|libs(?:wanted)?)_nolargefiles/) { # These are purely virtual, they do not exist, but need to # be computed on demand for largefile-incapable extensions. my $key = "${1}_uselargefiles"; $value = $Config{$1}; my $withlargefiles = $Config{$key}; if ($key =~ /^(?:cc|ld)flags_/) { $value =~ s/\Q$withlargefiles\E\b//; } elsif ($key =~ /^libs/) { my @lflibswanted = split(' ', $Config{libswanted_uselargefiles}); if (@lflibswanted) { my %lflibswanted; @lflibswanted{@lflibswanted} = (); if ($key =~ /^libs_/) { my @libs = grep { /^-l(.+)/ && not exists $lflibswanted{$1} } split(' ', $Config{libs}); $Config{libs} = join(' ', @libs); } elsif ($key =~ /^libswanted_/) { my @libswanted = grep { not exists $lflibswanted{$_} } split(' ', $Config{libswanted}); $Config{libswanted} = join(' ', @libswanted); } } } } else { $marker = "$_[1]="; # return undef unless (($value) = $config_sh =~ m/^$_[1]='(.*)'\s*$/m); # Check for the common case, ' delimeted $start = index($config_sh, "\n$marker$quote_type"); # If that failed, check for " delimited if ($start == -1) { $quote_type = '"'; $start = index($config_sh, "\n$marker$quote_type"); } return undef if ( ($start == -1) && # in case it's first (substr($config_sh, 0, length($marker)) ne $marker) ); if ($start == -1) { # It's the very first thing we found. Skip $start forward # and figure out the quote mark after the =. $start = length($marker) + 1; $quote_type = substr($config_sh, $start - 1, 1); } else { $start += length($marker) + 2; } $value = substr($config_sh, $start, index($config_sh, "$quote_type\n", $start) - $start); } # If we had a double-quote, we'd better eval it so escape # sequences and such can be interpolated. Since the incoming # value is supposed to follow shell rules and not perl rules, # we escape any perl variable markers if ($quote_type eq '"') { $value =~ s/\$/\\\$/g; $value =~ s/\@/\\\@/g; eval "\$value = \"$value\""; } #$value = sprintf($value) if $quote_type eq '"'; # So we can say "if $Config{'foo'}". $value = undef if $value eq 'undef'; $_[0]->{$_[1]} = $value; # cache it return $value; } my $prevpos = 0; sub FIRSTKEY { $prevpos = 0; # my($key) = $config_sh =~ m/^(.*?)=/; substr($config_sh, 0, index($config_sh, '=') ); # $key; } sub NEXTKEY { # Find out how the current key's quoted so we can skip to its end. my $quote = substr($config_sh, index($config_sh, "=", $prevpos)+1, 1); my $pos = index($config_sh, qq($quote\n), $prevpos) + 2; my $len = index($config_sh, "=", $pos) - $pos; $prevpos = $pos; $len > 0 ? substr($config_sh, $pos, $len) : undef; } sub EXISTS { # exists($_[0]->{$_[1]}) or $config_sh =~ m/^$_[1]=/m; exists($_[0]->{$_[1]}) or index($config_sh, "\n$_[1]='") != -1 or substr($config_sh, 0, length($_[1])+2) eq "$_[1]='" or index($config_sh, "\n$_[1]=\"") != -1 or substr($config_sh, 0, length($_[1])+2) eq "$_[1]=\"" or $_[1] =~ /^(?:(?:cc|ld)flags|libs(?:wanted)?)_nolargefiles$/; } sub STORE { die "\%Config::Config is read-only\n" } sub DELETE { &STORE } sub CLEAR { &STORE } sub config_sh { $config_sh } sub config_re { my $re = shift; my @matches = grep /^$re=/, split /^/, $config_sh; @matches ? (print @matches) : print "$re: not found\n"; } sub config_vars { foreach(@_){ config_re($_), next if /\W/; my $v=(exists $Config{$_}) ? $Config{$_} : 'UNKNOWN'; $v='undef' unless defined $v; print "$_='$v';\n"; } } sub TIEHASH { bless {} } # avoid Config..Exporter..UNIVERSAL search for DESTROY then AUTOLOAD sub DESTROY { } tie %Config, 'Config'; 1; __END__ #line 8948 FILE 099837ef/Cwd.pm */#line 1 "/usr/lib/perl5/5.8.0/i386-linux-thread-multi/Cwd.pm" package Cwd; use 5.006; #line 148 use strict; use Carp; our $VERSION = '2.06'; use base qw/ Exporter /; our @EXPORT = qw(cwd getcwd fastcwd fastgetcwd); our @EXPORT_OK = qw(chdir abs_path fast_abs_path realpath fast_realpath); # sys_cwd may keep the builtin command # All the functionality of this module may provided by builtins, # there is no sense to process the rest of the file. # The best choice may be to have this in BEGIN, but how to return from BEGIN? if ($^O eq 'os2' && defined &sys_cwd && defined &sys_abspath) { local $^W = 0; *cwd = \&sys_cwd; *getcwd = \&cwd; *fastgetcwd = \&cwd; *fastcwd = \&cwd; *abs_path = \&sys_abspath; *fast_abs_path = \&abs_path; *realpath = \&abs_path; *fast_realpath = \&abs_path; return 1; } eval { require XSLoader; undef *Cwd::fastcwd; # avoid redefinition warning XSLoader::load('Cwd'); }; # Find the pwd command in the expected locations. We assume these # are safe. This prevents _backtick_pwd() consulting $ENV{PATH} # so everything works under taint mode. my $pwd_cmd; foreach my $try (qw(/bin/pwd /usr/bin/pwd)) { if( -x $try ) { $pwd_cmd = $try; last; } } $pwd_cmd ||= 'pwd'; # The 'natural and safe form' for UNIX (pwd may be setuid root) sub _backtick_pwd { local @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)}; my $cwd = `$pwd_cmd`; # Belt-and-suspenders in case someone said "undef $/". local $/ = "\n"; # `pwd` may fail e.g. if the disk is full chomp($cwd) if defined $cwd; $cwd; } # Since some ports may predefine cwd internally (e.g., NT) # we take care not to override an existing definition for cwd(). unless(defined &cwd) { # The pwd command is not available in some chroot(2)'ed environments if( $^O eq 'MacOS' || (defined $ENV{PATH} && grep { -x "$_/pwd" } split(':', $ENV{PATH})) ) { *cwd = \&_backtick_pwd; } else { *cwd = \&getcwd; } } # set a reasonable (and very safe) default for fastgetcwd, in case it # isn't redefined later (20001212 rspier) *fastgetcwd = \&cwd; # By Brandon S. Allbery # # Usage: $cwd = getcwd(); sub getcwd { abs_path('.'); } # By John Bazik # # Usage: $cwd = &fastcwd; # # This is a faster version of getcwd. It's also more dangerous because # you might chdir out of a directory that you can't chdir back into. sub fastcwd { my($odev, $oino, $cdev, $cino, $tdev, $tino); my(@path, $path); local(*DIR); my($orig_cdev, $orig_cino) = stat('.'); ($cdev, $cino) = ($orig_cdev, $orig_cino); for (;;) { my $direntry; ($odev, $oino) = ($cdev, $cino); CORE::chdir('..') || return undef; ($cdev, $cino) = stat('.'); last if $odev == $cdev && $oino == $cino; opendir(DIR, '.') || return undef; for (;;) { $direntry = readdir(DIR); last unless defined $direntry; next if $direntry eq '.'; next if $direntry eq '..'; ($tdev, $tino) = lstat($direntry); last unless $tdev != $odev || $tino != $oino; } closedir(DIR); return undef unless defined $direntry; # should never happen unshift(@path, $direntry); } $path = '/' . join('/', @path); if ($^O eq 'apollo') { $path = "/".$path; } # At this point $path may be tainted (if tainting) and chdir would fail. # Untaint it then check that we landed where we started. $path =~ /^(.*)\z/s # untaint && CORE::chdir($1) or return undef; ($cdev, $cino) = stat('.'); die "Unstable directory path, current directory changed unexpectedly" if $cdev != $orig_cdev || $cino != $orig_cino; $path; } # Keeps track of current working directory in PWD environment var # Usage: # use Cwd 'chdir'; # chdir $newdir; my $chdir_init = 0; sub chdir_init { if ($ENV{'PWD'} and $^O ne 'os2' and $^O ne 'dos' and $^O ne 'MSWin32') { my($dd,$di) = stat('.'); my($pd,$pi) = stat($ENV{'PWD'}); if (!defined $dd or !defined $pd or $di != $pi or $dd != $pd) { $ENV{'PWD'} = cwd(); } } else { my $wd = cwd(); $wd = Win32::GetFullPathName($wd) if $^O eq 'MSWin32'; $ENV{'PWD'} = $wd; } # Strip an automounter prefix (where /tmp_mnt/foo/bar == /foo/bar) if ($^O ne 'MSWin32' and $ENV{'PWD'} =~ m|(/[^/]+(/[^/]+/[^/]+))(.*)|s) { my($pd,$pi) = stat($2); my($dd,$di) = stat($1); if (defined $pd and defined $dd and $di == $pi and $dd == $pd) { $ENV{'PWD'}="$2$3"; } } $chdir_init = 1; } sub chdir { my $newdir = @_ ? shift : ''; # allow for no arg (chdir to HOME dir) $newdir =~ s|///*|/|g unless $^O eq 'MSWin32'; chdir_init() unless $chdir_init; my $newpwd; if ($^O eq 'MSWin32') { # get the full path name *before* the chdir() $newpwd = Win32::GetFullPathName($newdir); } return 0 unless CORE::chdir $newdir; if ($^O eq 'VMS') { return $ENV{'PWD'} = $ENV{'DEFAULT'} } elsif ($^O eq 'MacOS') { return $ENV{'PWD'} = cwd(); } elsif ($^O eq 'MSWin32') { $ENV{'PWD'} = $newpwd; return 1; } if ($newdir =~ m#^/#s) { $ENV{'PWD'} = $newdir; } else { my @curdir = split(m#/#,$ENV{'PWD'}); @curdir = ('') unless @curdir; my $component; foreach $component (split(m#/#, $newdir)) { next if $component eq '.'; pop(@curdir),next if $component eq '..'; push(@curdir,$component); } $ENV{'PWD'} = join('/',@curdir) || '/'; } 1; } # In case the XS version doesn't load. *abs_path = \&_perl_abs_path unless defined &abs_path; sub _perl_abs_path { my $start = @_ ? shift : '.'; my($dotdots, $cwd, @pst, @cst, $dir, @tst); unless (@cst = stat( $start )) { carp "stat($start): $!"; return ''; } $cwd = ''; $dotdots = $start; do { $dotdots .= '/..'; @pst = @cst; unless (opendir(PARENT, $dotdots)) { carp "opendir($dotdots): $!"; return ''; } unless (@cst = stat($dotdots)) { carp "stat($dotdots): $!"; closedir(PARENT); return ''; } if ($pst[0] == $cst[0] && $pst[1] == $cst[1]) { $dir = undef; } else { do { unless (defined ($dir = readdir(PARENT))) { carp "readdir($dotdots): $!"; closedir(PARENT); return ''; } $tst[0] = $pst[0]+1 unless (@tst = lstat("$dotdots/$dir")) } while ($dir eq '.' || $dir eq '..' || $tst[0] != $pst[0] || $tst[1] != $pst[1]); } $cwd = (defined $dir ? "$dir" : "" ) . "/$cwd" ; closedir(PARENT); } while (defined $dir); chop($cwd) unless $cwd eq '/'; # drop the trailing / $cwd; } # added function alias for those of us more # used to the libc function. --tchrist 27-Jan-00 *realpath = \&abs_path; sub fast_abs_path { my $cwd = getcwd(); require File::Spec; my $path = @_ ? shift : File::Spec->curdir; CORE::chdir($path) || croak "Cannot chdir to $path: $!"; my $realpath = getcwd(); -d $cwd && CORE::chdir($cwd) || croak "Cannot chdir back to $cwd: $!"; $realpath; } # added function alias to follow principle of least surprise # based on previous aliasing. --tchrist 27-Jan-00 *fast_realpath = \&fast_abs_path; # --- PORTING SECTION --- # VMS: $ENV{'DEFAULT'} points to default directory at all times # 06-Mar-1996 Charles Bailey bailey@newman.upenn.edu # Note: Use of Cwd::chdir() causes the logical name PWD to be defined # in the process logical name table as the default device and directory # seen by Perl. This may not be the same as the default device # and directory seen by DCL after Perl exits, since the effects # the CRTL chdir() function persist only until Perl exits. sub _vms_cwd { return $ENV{'DEFAULT'}; } sub _vms_abs_path { return $ENV{'DEFAULT'} unless @_; my $path = VMS::Filespec::pathify($_[0]); croak("Invalid path name $_[0]") unless defined $path; return VMS::Filespec::rmsexpand($path); } sub _os2_cwd { $ENV{'PWD'} = `cmd /c cd`; chop $ENV{'PWD'}; $ENV{'PWD'} =~ s:\\:/:g ; return $ENV{'PWD'}; } sub _win32_cwd { $ENV{'PWD'} = Win32::GetCwd(); $ENV{'PWD'} =~ s:\\:/:g ; return $ENV{'PWD'}; } *_NT_cwd = \&_win32_cwd if (!defined &_NT_cwd && defined &Win32::GetCwd); *_NT_cwd = \&_os2_cwd unless defined &_NT_cwd; sub _dos_cwd { if (!defined &Dos::GetCwd) { $ENV{'PWD'} = `command /c cd`; chop $ENV{'PWD'}; $ENV{'PWD'} =~ s:\\:/:g ; } else { $ENV{'PWD'} = Dos::GetCwd(); } return $ENV{'PWD'}; } sub _qnx_cwd { local $ENV{PATH} = ''; local $ENV{CDPATH} = ''; local $ENV{ENV} = ''; $ENV{'PWD'} = `/usr/bin/fullpath -t`; chop $ENV{'PWD'}; return $ENV{'PWD'}; } sub _qnx_abs_path { local $ENV{PATH} = ''; local $ENV{CDPATH} = ''; local $ENV{ENV} = ''; my $path = @_ ? shift : '.'; my $realpath=`/usr/bin/fullpath -t $path`; chop $realpath; return $realpath; } sub _epoc_cwd { $ENV{'PWD'} = EPOC::getcwd(); return $ENV{'PWD'}; } { no warnings; # assignments trigger 'subroutine redefined' warning if ($^O eq 'VMS') { *cwd = \&_vms_cwd; *getcwd = \&_vms_cwd; *fastcwd = \&_vms_cwd; *fastgetcwd = \&_vms_cwd; *abs_path = \&_vms_abs_path; *fast_abs_path = \&_vms_abs_path; } elsif ($^O eq 'NT' or $^O eq 'MSWin32') { # We assume that &_NT_cwd is defined as an XSUB or in the core. *cwd = \&_NT_cwd; *getcwd = \&_NT_cwd; *fastcwd = \&_NT_cwd; *fastgetcwd = \&_NT_cwd; *abs_path = \&fast_abs_path; *realpath = \&fast_abs_path; } elsif ($^O eq 'os2') { # sys_cwd may keep the builtin command *cwd = defined &sys_cwd ? \&sys_cwd : \&_os2_cwd; *getcwd = \&cwd; *fastgetcwd = \&cwd; *fastcwd = \&cwd; *abs_path = \&fast_abs_path; } elsif ($^O eq 'dos') { *cwd = \&_dos_cwd; *getcwd = \&_dos_cwd; *fastgetcwd = \&_dos_cwd; *fastcwd = \&_dos_cwd; *abs_path = \&fast_abs_path; } elsif ($^O =~ m/^(?:qnx|nto)$/ ) { *cwd = \&_qnx_cwd; *getcwd = \&_qnx_cwd; *fastgetcwd = \&_qnx_cwd; *fastcwd = \&_qnx_cwd; *abs_path = \&_qnx_abs_path; *fast_abs_path = \&_qnx_abs_path; } elsif ($^O eq 'cygwin') { *getcwd = \&cwd; *fastgetcwd = \&cwd; *fastcwd = \&cwd; *abs_path = \&fast_abs_path; } elsif ($^O eq 'epoc') { *cwd = \&_epoc_cwd; *getcwd = \&_epoc_cwd; *fastgetcwd = \&_epoc_cwd; *fastcwd = \&_epoc_cwd; *abs_path = \&fast_abs_path; } elsif ($^O eq 'MacOS') { *getcwd = \&cwd; *fastgetcwd = \&cwd; *fastcwd = \&cwd; *abs_path = \&fast_abs_path; } } 1; FILE 0898e244/DynaLoader.pm 7g#line 1 "/usr/lib/perl5/5.8.0/i386-linux-thread-multi/DynaLoader.pm" # Generated from DynaLoader.pm.PL package DynaLoader; # And Gandalf said: 'Many folk like to know beforehand what is to # be set on the table; but those who have laboured to prepare the # feast like to keep their secret; for wonder makes the words of # praise louder.' # (Quote from Tolkien suggested by Anno Siegel.) # # See pod text at end of file for documentation. # See also ext/DynaLoader/README in source tree for other information. # # Tim.Bunce@ig.co.uk, August 1994 use vars qw($VERSION *AUTOLOAD); $VERSION = 1.04; # avoid typo warning require AutoLoader; *AUTOLOAD = \&AutoLoader::AUTOLOAD; use Config; # The following require can't be removed during maintenance # releases, sadly, because of the risk of buggy code that does # require Carp; Carp::croak "..."; without brackets dying # if Carp hasn't been loaded in earlier compile time. :-( # We'll let those bugs get found on the development track. require Carp if $] < 5.00450; # enable debug/trace messages from DynaLoader perl code $dl_debug = $ENV{PERL_DL_DEBUG} || 0 unless defined $dl_debug; # # Flags to alter dl_load_file behaviour. Assigned bits: # 0x01 make symbols available for linking later dl_load_file's. # (only known to work on Solaris 2 using dlopen(RTLD_GLOBAL)) # (ignored under VMS; effect is built-in to image linking) # # This is called as a class method $module->dl_load_flags. The # definition here will be inherited and result on "default" loading # behaviour unless a sub-class of DynaLoader defines its own version. # sub dl_load_flags { 0x00 } # ($dl_dlext, $dlsrc) # = @Config::Config{'dlext', 'dlsrc'}; ($dl_dlext, $dlsrc) = ('so','dl_dlopen.xs') ; # Some systems need special handling to expand file specifications # (VMS support by Charles Bailey <bailey@HMIVAX.HUMGEN.UPENN.EDU>) # See dl_expandspec() for more details. Should be harmless but # inefficient to define on systems that don't need it. $Is_VMS = $^O eq 'VMS'; $do_expand = $Is_VMS; $Is_MacOS = $^O eq 'MacOS'; my $Mac_FS; $Mac_FS = eval { require Mac::FileSpec::Unixish } if $Is_MacOS; @dl_require_symbols = (); # names of symbols we need @dl_resolve_using = (); # names of files to link with @dl_library_path = (); # path to look for files #XSLoader.pm may have added elements before we were required #@dl_librefs = (); # things we have loaded #@dl_modules = (); # Modules we have loaded # This is a fix to support DLD's unfortunate desire to relink -lc @dl_resolve_using = dl_findfile('-lc') if $dlsrc eq "dl_dld.xs"; # Initialise @dl_library_path with the 'standard' library path # for this platform as determined by Configure. push(@dl_library_path, split(' ', $Config::Config{libpth})); my $ldlibpthname = $Config::Config{ldlibpthname}; my $ldlibpthname_defined = defined $Config::Config{ldlibpthname}; my $pthsep = $Config::Config{path_sep}; # Add to @dl_library_path any extra directories we can gather from environment # during runtime. if ($ldlibpthname_defined && exists $ENV{$ldlibpthname}) { push(@dl_library_path, split(/$pthsep/, $ENV{$ldlibpthname})); } # E.g. HP-UX supports both its native SHLIB_PATH *and* LD_LIBRARY_PATH. if ($ldlibpthname_defined && $ldlibpthname ne 'LD_LIBRARY_PATH' && exists $ENV{LD_LIBRARY_PATH}) { push(@dl_library_path, split(/$pthsep/, $ENV{LD_LIBRARY_PATH})); } # No prizes for guessing why we don't say 'bootstrap DynaLoader;' here. # NOTE: All dl_*.xs (including dl_none.xs) define a dl_error() XSUB boot_DynaLoader('DynaLoader') if defined(&boot_DynaLoader) && !defined(&dl_error); if ($dl_debug) { print STDERR "DynaLoader.pm loaded (@INC, @dl_library_path)\n"; print STDERR "DynaLoader not linked into this perl\n" unless defined(&boot_DynaLoader); } 1; # End of main code sub croak { require Carp; Carp::croak(@_) } sub bootstrap_inherit { my $module = $_[0]; local *isa = *{"$module\::ISA"}; local @isa = (@isa, 'DynaLoader'); # Cannot goto due to delocalization. Will report errors on a wrong line? bootstrap(@_); } # The bootstrap function cannot be autoloaded (without complications) # so we define it here: sub bootstrap { # use local vars to enable $module.bs script to edit values local(@args) = @_; local($module) = $args[0]; local(@dirs, $file); unless ($module) { require Carp; Carp::confess("Usage: DynaLoader::bootstrap(module)"); } # A common error on platforms which don't support dynamic loading. # Since it's fatal and potentially confusing we give a detailed message. croak("Can't load module $module, dynamic loading not available in this perl.\n". " (You may need to build a new perl executable which either supports\n". " dynamic loading or has the $module module statically linked into it.)\n") unless defined(&dl_load_file); my @modparts = split(/::/,$module); my $modfname = $modparts[-1]; # Some systems have restrictions on files names for DLL's etc. # mod2fname returns appropriate file base name (typically truncated) # It may also edit @modparts if required. $modfname = &mod2fname(\@modparts) if defined &mod2fname; # Truncate the module name to 8.3 format for NetWare if (($^O eq 'NetWare') && (length($modfname) > 8)) { $modfname = substr($modfname, 0, 8); } my $modpname = join(($Is_MacOS ? ':' : '/'),@modparts); print STDERR "DynaLoader::bootstrap for $module ", ($Is_MacOS ? "(:auto:$modpname:$modfname.$dl_dlext)\n" : "(auto/$modpname/$modfname.$dl_dlext)\n") if $dl_debug; foreach (@INC) { chop($_ = VMS::Filespec::unixpath($_)) if $Is_VMS; my $dir; if ($Is_MacOS) { my $path = $_; if ($Mac_FS && ! -d $path) { $path = Mac::FileSpec::Unixish::nativize($path); } $path .= ":" unless /:$/; $dir = "${path}auto:$modpname"; } else { $dir = "$_/auto/$modpname"; } next unless -d $dir; # skip over uninteresting directories # check for common cases to avoid autoload of dl_findfile my $try = $Is_MacOS ? "$dir:$modfname.$dl_dlext" : "$dir/$modfname.$dl_dlext"; last if $file = ($do_expand) ? dl_expandspec($try) : ((-f $try) && $try); # no luck here, save dir for possible later dl_findfile search push @dirs, $dir; } # last resort, let dl_findfile have a go in all known locations $file = dl_findfile(map("-L$_",@dirs,@INC), $modfname) unless $file; croak("Can't locate loadable object for module $module in \@INC (\@INC contains: @INC)") unless $file; # wording similar to error from 'require' $file = uc($file) if $Is_VMS && $Config::Config{d_vms_case_sensitive_symbols}; my $bootname = "boot_$module"; $bootname =~ s/\W/_/g; @dl_require_symbols = ($bootname); # Execute optional '.bootstrap' perl script for this module. # The .bs file can be used to configure @dl_resolve_using etc to # match the needs of the individual module on this architecture. my $bs = $file; $bs =~ s/(\.\w+)?(;\d*)?$/\.bs/; # look for .bs 'beside' the library if (-s $bs) { # only read file if it's not empty print STDERR "BS: $bs ($^O, $dlsrc)\n" if $dl_debug; eval { do $bs; }; warn "$bs: $@\n" if $@; } my $boot_symbol_ref; if ($^O eq 'darwin') { if ($boot_symbol_ref = dl_find_symbol(0, $bootname)) { goto boot; #extension library has already been loaded, e.g. darwin } } # Many dynamic extension loading problems will appear to come from # this section of code: XYZ failed at line 123 of DynaLoader.pm. # Often these errors are actually occurring in the initialisation # C code of the extension XS file. Perl reports the error as being # in this perl code simply because this was the last perl code # it executed. my $libref = dl_load_file($file, $module->dl_load_flags) or croak("Can't load '$file' for module $module: ".dl_error()); push(@dl_librefs,$libref); # record loaded object my @unresolved = dl_undef_symbols(); if (@unresolved) { require Carp; Carp::carp("Undefined symbols present after loading $file: @unresolved\n"); } $boot_symbol_ref = dl_find_symbol($libref, $bootname) or croak("Can't find '$bootname' symbol in $file\n"); push(@dl_modules, $module); # record loaded module boot: my $xs = dl_install_xsub("${module}::bootstrap", $boot_symbol_ref, $file); # See comment block above &$xs(@args); } #sub _check_file { # private utility to handle dl_expandspec vs -f tests # my($file) = @_; # return $file if (!$do_expand && -f $file); # the common case # return $file if ( $do_expand && ($file=dl_expandspec($file))); # return undef; #} # Let autosplit and the autoloader deal with these functions: __END__ sub dl_findfile { # Read ext/DynaLoader/DynaLoader.doc for detailed information. # This function does not automatically consider the architecture # or the perl library auto directories. my (@args) = @_; my (@dirs, $dir); # which directories to search my (@found); # full paths to real files we have found my $dl_ext= 'so'; # $Config::Config{'dlext'} suffix for perl extensions my $dl_so = 'so'; # $Config::Config{'so'} suffix for shared libraries print STDERR "dl_findfile(@args)\n" if $dl_debug; # accumulate directories but process files as they appear arg: foreach(@args) { # Special fast case: full filepath requires no search if ($Is_VMS && m%[:>/\]]% && -f $_) { push(@found,dl_expandspec(VMS::Filespec::vmsify($_))); last arg unless wantarray; next; } elsif ($Is_MacOS) { if (m/:/ && -f $_) { push(@found,$_); last arg unless wantarray; } } elsif (m:/: && -f $_ && !$do_expand) { push(@found,$_); last arg unless wantarray; next; } # Deal with directories first: # Using a -L prefix is the preferred option (faster and more robust) if (m:^-L:) { s/^-L//; push(@dirs, $_); next; } if ($Is_MacOS) { # Otherwise we try to try to spot directories by a heuristic # (this is a more complicated issue than it first appears) if (m/:/ && -d $_) { push(@dirs, $_); next; } # Only files should get this far... my(@names, $name); # what filenames to look for s/^-l//; push(@names, $_); foreach $dir (@dirs, @dl_library_path) { next unless -d $dir; $dir =~ s/^([^:]+)$/:$1/; $dir =~ s/:$//; foreach $name (@names) { my($file) = "$dir:$name"; print STDERR " checking in $dir for $name\n" if $dl_debug; if (-f $file) { push(@found, $file); next arg; # no need to look any further } } } next; } # Otherwise we try to try to spot directories by a heuristic # (this is a more complicated issue than it first appears) if (m:/: && -d $_) { push(@dirs, $_); next; } # VMS: we may be using native VMS directory syntax instead of # Unix emulation, so check this as well if ($Is_VMS && /[:>\]]/ && -d $_) { push(@dirs, $_); next; } # Only files should get this far... my(@names, $name); # what filenames to look for if (m:-l: ) { # convert -lname to appropriate library name s/-l//; push(@names,"lib$_.$dl_so"); push(@names,"lib$_.a"); } else { # Umm, a bare name. Try various alternatives: # these should be ordered with the most likely first push(@names,"$_.$dl_ext") unless m/\.$dl_ext$/o; push(@names,"$_.$dl_so") unless m/\.$dl_so$/o; push(@names,"lib$_.$dl_so") unless m:/:; push(@names,"$_.a") if !m/\.a$/ and $dlsrc eq "dl_dld.xs"; push(@names, $_); } foreach $dir (@dirs, @dl_library_path) { next unless -d $dir; chop($dir = VMS::Filespec::unixpath($dir)) if $Is_VMS; foreach $name (@names) { my($file) = "$dir/$name"; print STDERR " checking in $dir for $name\n" if $dl_debug; $file = ($do_expand) ? dl_expandspec($file) : (-f $file && $file); #$file = _check_file($file); if ($file) { push(@found, $file); next arg; # no need to look any further } } } } if ($dl_debug) { foreach(@dirs) { print STDERR " dl_findfile ignored non-existent directory: $_\n" unless -d $_; } print STDERR "dl_findfile found: @found\n"; } return $found[0] unless wantarray; @found; } sub dl_expandspec { my($spec) = @_; # Optional function invoked if DynaLoader.pm sets $do_expand. # Most systems do not require or use this function. # Some systems may implement it in the dl_*.xs file in which case # this autoload version will not be called but is harmless. # This function is designed to deal with systems which treat some # 'filenames' in a special way. For example VMS 'Logical Names' # (something like unix environment variables - but different). # This function should recognise such names and expand them into # full file paths. # Must return undef if $spec is invalid or file does not exist. my $file = $spec; # default output to input if ($Is_VMS) { # dl_expandspec should be defined in dl_vms.xs require Carp; Carp::croak("dl_expandspec: should be defined in XS file!\n"); } else { return undef unless -f $file; } print STDERR "dl_expandspec($spec) => $file\n" if $dl_debug; $file; } sub dl_find_symbol_anywhere { my $sym = shift; my $libref; foreach $libref (@dl_librefs) { my $symref = dl_find_symbol($libref,$sym); return $symref if $symref; } return undef; } #line 827 FILE 56244356/Errno.pm l#line 1 "/usr/lib/perl5/5.8.0/i386-linux-thread-multi/Errno.pm" # # This file is auto-generated. ***ANY*** changes here will be lost # package Errno; our (@EXPORT_OK,%EXPORT_TAGS,@ISA,$VERSION,%errno,$AUTOLOAD); use Exporter (); use Config; use strict; "$Config{'archname'}-$Config{'osvers'}" eq "i386-linux-thread-multi-2.4.18-11smp" or die "Errno architecture (i386-linux-thread-multi-2.4.18-11smp) does not match executable architecture ($Config{'archname'}-$Config{'osvers'})"; $VERSION = "1.09_00"; $VERSION = eval $VERSION; @ISA = qw(Exporter); @EXPORT_OK = qw(EBADR EADV EUCLEAN ENOMSG EROFS ENOTSUP ESHUTDOWN EMULTIHOP EPROTONOSUPPORT ENOLCK ENFILE ESTRPIPE EL3HLT EADDRINUSE ECONNABORTED EBADF ECANCELED ENAVAIL ENOTBLK EDEADLK ECHRNG ENOLINK ESRMNT ENOTNAM ELNRNG ENOTDIR ETIME EINVAL ENOTTY ENOANO EXDEV EBADE ELOOP EBADSLT ECONNREFUSED ENOSTR EOVERFLOW EISCONN ENONET EFBIG ECONNRESET EPFNOSUPPORT ENOENT EWOULDBLOCK ELIBMAX EREMOTEIO EBADMSG ENOMEDIUM EL2HLT ENOPKG EDOM EBFONT ELIBSCN EMSGSIZE ENOCSI EL3RST EDESTADDRREQ ENOTSOCK EIO ENOSPC EIDRM EMEDIUMTYPE ERANGE EINPROGRESS ENOBUFS EADDRNOTAVAIL EAFNOSUPPORT ENOSYS EINTR EHOSTDOWN EILSEQ EREMOTE EBADFD ENOSR ENOMEM ENETUNREACH EPIPE ENOTCONN ESTALE ENODATA EDQUOT EUSERS EOPNOTSUPP EPROTO EISNAM ESPIPE EALREADY ENAMETOOLONG EMFILE EACCES ENOEXEC EISDIR EBUSY EBADRQC EPERM E2BIG ELIBEXEC EEXIST EDOTDOT ETOOMANYREFS ELIBACC ENOTUNIQ ECOMM ELIBBAD ERESTART ESOCKTNOSUPPORT EUNATCH ETIMEDOUT ENXIO ESRCH ENODEV ETXTBSY EFAULT EMLINK EDEADLOCK EXFULL EAGAIN ENOPROTOOPT ECHILD ENETDOWN EHOSTUNREACH EPROTOTYPE EREMCHG EL2NSYNC ENETRESET ENOTEMPTY); %EXPORT_TAGS = ( POSIX => [qw( E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EAFNOSUPPORT EAGAIN EALREADY EBADF EBUSY ECHILD ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK EDESTADDRREQ EDOM EDQUOT EEXIST EFAULT EFBIG EHOSTDOWN EHOSTUNREACH EINPROGRESS EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK EMSGSIZE ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH ENFILE ENOBUFS ENODEV ENOENT ENOEXEC ENOLCK ENOMEM ENOPROTOOPT ENOSPC ENOSYS ENOTBLK ENOTCONN ENOTDIR ENOTEMPTY ENOTSOCK ENOTTY ENXIO EOPNOTSUPP EPERM EPFNOSUPPORT EPIPE EPROTONOSUPPORT EPROTOTYPE ERANGE EREMOTE ERESTART EROFS ESHUTDOWN ESOCKTNOSUPPORT ESPIPE ESRCH ESTALE ETIMEDOUT ETOOMANYREFS ETXTBSY EUSERS EWOULDBLOCK EXDEV )] ); sub EPERM () { 1 } sub ENOENT () { 2 } sub ESRCH () { 3 } sub EINTR () { 4 } sub EIO () { 5 } sub ENXIO () { 6 } sub E2BIG () { 7 } sub ENOEXEC () { 8 } sub EBADF () { 9 } sub ECHILD () { 10 } sub EWOULDBLOCK () { 11 } sub EAGAIN () { 11 } sub ENOMEM () { 12 } sub EACCES () { 13 } sub EFAULT () { 14 } sub ENOTBLK () { 15 } sub EBUSY () { 16 } sub EEXIST () { 17 } sub EXDEV () { 18 } sub ENODEV () { 19 } sub ENOTDIR () { 20 } sub EISDIR () { 21 } sub EINVAL () { 22 } sub ENFILE () { 23 } sub EMFILE () { 24 } sub ENOTTY () { 25 } sub ETXTBSY () { 26 } sub EFBIG () { 27 } sub ENOSPC () { 28 } sub ESPIPE () { 29 } sub EROFS () { 30 } sub EMLINK () { 31 } sub EPIPE () { 32 } sub EDOM () { 33 } sub ERANGE () { 34 } sub EDEADLK () { 35 } sub EDEADLOCK () { 35 } sub ENAMETOOLONG () { 36 } sub ENOLCK () { 37 } sub ENOSYS () { 38 } sub ENOTEMPTY () { 39 } sub ELOOP () { 40 } sub ENOMSG () { 42 } sub EIDRM () { 43 } sub ECHRNG () { 44 } sub EL2NSYNC () { 45 } sub EL3HLT () { 46 } sub EL3RST () { 47 } sub ELNRNG () { 48 } sub EUNATCH () { 49 } sub ENOCSI () { 50 } sub EL2HLT () { 51 } sub EBADE () { 52 } sub EBADR () { 53 } sub EXFULL () { 54 } sub ENOANO () { 55 } sub EBADRQC () { 56 } sub EBADSLT () { 57 } sub EBFONT () { 59 } sub ENOSTR () { 60 } sub ENODATA () { 61 } sub ETIME () { 62 } sub ENOSR () { 63 } sub ENONET () { 64 } sub ENOPKG () { 65 } sub EREMOTE () { 66 } sub ENOLINK () { 67 } sub EADV () { 68 } sub ESRMNT () { 69 } sub ECOMM () { 70 } sub EPROTO () { 71 } sub EMULTIHOP () { 72 } sub EDOTDOT () { 73 } sub EBADMSG () { 74 } sub EOVERFLOW () { 75 } sub ENOTUNIQ () { 76 } sub EBADFD () { 77 } sub EREMCHG () { 78 } sub ELIBACC () { 79 } sub ELIBBAD () { 80 } sub ELIBSCN () { 81 } sub ELIBMAX () { 82 } sub ELIBEXEC () { 83 } sub EILSEQ () { 84 } sub ERESTART () { 85 } sub ESTRPIPE () { 86 } sub EUSERS () { 87 } sub ENOTSOCK () { 88 } sub EDESTADDRREQ () { 89 } sub EMSGSIZE () { 90 } sub EPROTOTYPE () { 91 } sub ENOPROTOOPT () { 92 } sub EPROTONOSUPPORT () { 93 } sub ESOCKTNOSUPPORT () { 94 } sub ENOTSUP () { 95 } sub EOPNOTSUPP () { 95 } sub EPFNOSUPPORT () { 96 } sub EAFNOSUPPORT () { 97 } sub EADDRINUSE () { 98 } sub EADDRNOTAVAIL () { 99 } sub ENETDOWN () { 100 } sub ENETUNREACH () { 101 } sub ENETRESET () { 102 } sub ECONNABORTED () { 103 } sub ECONNRESET () { 104 } sub ENOBUFS () { 105 } sub EISCONN () { 106 } sub ENOTCONN () { 107 } sub ESHUTDOWN () { 108 } sub ETOOMANYREFS () { 109 } sub ETIMEDOUT () { 110 } sub ECONNREFUSED () { 111 } sub EHOSTDOWN () { 112 } sub EHOSTUNREACH () { 113 } sub EALREADY () { 114 } sub EINPROGRESS () { 115 } sub ESTALE () { 116 } sub EUCLEAN () { 117 } sub ENOTNAM () { 118 } sub ENAVAIL () { 119 } sub EISNAM () { 120 } sub EREMOTEIO () { 121 } sub EDQUOT () { 122 } sub ENOMEDIUM () { 123 } sub EMEDIUMTYPE () { 124 } sub ECANCELED () { 125 } sub TIEHASH { bless [] } sub FETCH { my ($self, $errname) = @_; my $proto = prototype("Errno::$errname"); my $errno = ""; if (defined($proto) && $proto eq "") { no strict 'refs'; $errno = &$errname; $errno = 0 unless $! == $errno; } return $errno; } sub STORE { require Carp; Carp::confess("ERRNO hash is read only!"); } *CLEAR = \&STORE; *DELETE = \&STORE; sub NEXTKEY { my($k,$v); while(($k,$v) = each %Errno::) { my $proto = prototype("Errno::$k"); last if (defined($proto) && $proto eq ""); } $k } sub FIRSTKEY { my $s = scalar keys %Errno::; # initialize iterator goto &NEXTKEY; } sub EXISTS { my ($self, $errname) = @_; my $proto = prototype($errname); defined($proto) && $proto eq ""; } tie %!, __PACKAGE__; 1; __END__ #line 277 FILE 5759668f/Fcntl.pm #line 1 "/usr/lib/perl5/5.8.0/i386-linux-thread-multi/Fcntl.pm" package Fcntl; #line 57 our($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS, $AUTOLOAD); require Exporter; use XSLoader (); @ISA = qw(Exporter); $VERSION = "1.04"; # Items to export into callers namespace by default # (move infrequently used names to @EXPORT_OK below) @EXPORT = qw( FD_CLOEXEC F_ALLOCSP F_ALLOCSP64 F_COMPAT F_DUP2FD F_DUPFD F_EXLCK F_FREESP F_FREESP64 F_FSYNC F_FSYNC64 F_GETFD F_GETFL F_GETLK F_GETLK64 F_GETOWN F_NODNY F_POSIX F_RDACC F_RDDNY F_RDLCK F_RWACC F_RWDNY F_SETFD F_SETFL F_SETLK F_SETLK64 F_SETLKW F_SETLKW64 F_SETOWN F_SHARE F_SHLCK F_UNLCK F_UNSHARE F_WRACC F_WRDNY F_WRLCK O_ACCMODE O_ALIAS O_APPEND O_ASYNC O_BINARY O_CREAT O_DEFER O_DIRECT O_DIRECTORY O_DSYNC O_EXCL O_EXLOCK O_LARGEFILE O_NDELAY O_NOCTTY O_NOFOLLOW O_NOINHERIT O_NONBLOCK O_RANDOM O_RAW O_RDONLY O_RDWR O_RSRC O_RSYNC O_SEQUENTIAL O_SHLOCK O_SYNC O_TEMPORARY O_TEXT O_TRUNC O_WRONLY ); # Other items we are prepared to export if requested @EXPORT_OK = qw( FAPPEND FASYNC FCREAT FDEFER FDSYNC FEXCL FLARGEFILE FNDELAY FNONBLOCK FRSYNC FSYNC FTRUNC LOCK_EX LOCK_NB LOCK_SH LOCK_UN S_ISUID S_ISGID S_ISVTX S_ISTXT _S_IFMT S_IFREG S_IFDIR S_IFLNK S_IFSOCK S_IFBLK S_IFCHR S_IFIFO S_IFWHT S_ENFMT S_IRUSR S_IWUSR S_IXUSR S_IRWXU S_IRGRP S_IWGRP S_IXGRP S_IRWXG S_IROTH S_IWOTH S_IXOTH S_IRWXO S_IREAD S_IWRITE S_IEXEC &S_ISREG &S_ISDIR &S_ISLNK &S_ISSOCK &S_ISBLK &S_ISCHR &S_ISFIFO &S_ISWHT &S_ISENFMT &S_IFMT &S_IMODE SEEK_SET SEEK_CUR SEEK_END ); # Named groups of exports %EXPORT_TAGS = ( 'flock' => [qw(LOCK_SH LOCK_EX LOCK_NB LOCK_UN)], 'Fcompat' => [qw(FAPPEND FASYNC FCREAT FDEFER FDSYNC FEXCL FLARGEFILE FNDELAY FNONBLOCK FRSYNC FSYNC FTRUNC)], 'seek' => [qw(SEEK_SET SEEK_CUR SEEK_END)], 'mode' => [qw(S_ISUID S_ISGID S_ISVTX S_ISTXT _S_IFMT S_IFREG S_IFDIR S_IFLNK S_IFSOCK S_IFBLK S_IFCHR S_IFIFO S_IFWHT S_ENFMT S_IRUSR S_IWUSR S_IXUSR S_IRWXU S_IRGRP S_IWGRP S_IXGRP S_IRWXG S_IROTH S_IWOTH S_IXOTH S_IRWXO S_IREAD S_IWRITE S_IEXEC S_ISREG S_ISDIR S_ISLNK S_ISSOCK S_ISBLK S_ISCHR S_ISFIFO S_ISWHT S_ISENFMT S_IFMT S_IMODE )], ); sub S_IFMT { @_ ? ( $_[0] & _S_IFMT() ) : _S_IFMT() } sub S_IMODE { $_[0] & 07777 } sub S_ISREG { ( $_[0] & _S_IFMT() ) == S_IFREG() } sub S_ISDIR { ( $_[0] & _S_IFMT() ) == S_IFDIR() } sub S_ISLNK { ( $_[0] & _S_IFMT() ) == S_IFLNK() } sub S_ISSOCK { ( $_[0] & _S_IFMT() ) == S_IFSOCK() } sub S_ISBLK { ( $_[0] & _S_IFMT() ) == S_IFBLK() } sub S_ISCHR { ( $_[0] & _S_IFMT() ) == S_IFCHR() } sub S_ISFIFO { ( $_[0] & _S_IFMT() ) == S_IFIFO() } sub S_ISWHT { ( $_[0] & _S_IFMT() ) == S_IFWHT() } sub S_ISENFMT { ( $_[0] & _S_IFMT() ) == S_IFENFMT() } sub AUTOLOAD { (my $constname = $AUTOLOAD) =~ s/.*:://; die "&Fcntl::constant not defined" if $constname eq 'constant'; my ($error, $val) = constant($constname); if ($error) { my (undef,$file,$line) = caller; die "$error at $file line $line.\n"; } *$AUTOLOAD = sub { $val }; goto &$AUTOLOAD; } XSLoader::load 'Fcntl', $VERSION; 1; FILE 8bc7a4a7/File/Glob.pm #line 1 "/usr/lib/perl5/5.8.0/i386-linux-thread-multi/File/Glob.pm" package File::Glob; use strict; our($VERSION, @ISA, @EXPORT_OK, @EXPORT_FAIL, %EXPORT_TAGS, $AUTOLOAD, $DEFAULT_FLAGS); use XSLoader (); @ISA = qw(Exporter); # NOTE: The glob() export is only here for compatibility with 5.6.0. # csh_glob() should not be used directly, unless you know what you're doing. @EXPORT_OK = qw( csh_glob bsd_glob glob GLOB_ABEND GLOB_ALPHASORT GLOB_ALTDIRFUNC GLOB_BRACE GLOB_CSH GLOB_ERR GLOB_ERROR GLOB_LIMIT GLOB_MARK GLOB_NOCASE GLOB_NOCHECK GLOB_NOMAGIC GLOB_NOSORT GLOB_NOSPACE GLOB_QUOTE GLOB_TILDE ); %EXPORT_TAGS = ( 'glob' => [ qw( GLOB_ABEND GLOB_ALPHASORT GLOB_ALTDIRFUNC GLOB_BRACE GLOB_CSH GLOB_ERR GLOB_ERROR GLOB_LIMIT GLOB_MARK GLOB_NOCASE GLOB_NOCHECK GLOB_NOMAGIC GLOB_NOSORT GLOB_NOSPACE GLOB_QUOTE GLOB_TILDE glob bsd_glob ) ], ); $VERSION = '1.01'; sub import { require Exporter; my $i = 1; while ($i < @_) { if ($_[$i] =~ /^:(case|nocase|globally)$/) { splice(@_, $i, 1); $DEFAULT_FLAGS &= ~GLOB_NOCASE() if $1 eq 'case'; $DEFAULT_FLAGS |= GLOB_NOCASE() if $1 eq 'nocase'; if ($1 eq 'globally') { local $^W; *CORE::GLOBAL::glob = \&File::Glob::csh_glob; } next; } ++$i; } goto &Exporter::import; } sub AUTOLOAD { # This AUTOLOAD is used to 'autoload' constants from the constant() # XS function. If a constant is not found then control is passed # to the AUTOLOAD in AutoLoader. my $constname; ($constname = $AUTOLOAD) =~ s/.*:://; my ($error, $val) = constant($constname); if ($error) { require Carp; Carp::croak($error); } eval "sub $AUTOLOAD { $val }"; goto &$AUTOLOAD; } XSLoader::load 'File::Glob', $VERSION; # Preloaded methods go here. sub GLOB_ERROR { return (constant('GLOB_ERROR'))[1]; } sub GLOB_CSH () { GLOB_BRACE() | GLOB_NOMAGIC() | GLOB_QUOTE() | GLOB_TILDE() | GLOB_ALPHASORT() } $DEFAULT_FLAGS = GLOB_CSH(); if ($^O =~ /^(?:MSWin32|VMS|os2|dos|riscos|MacOS)$/) { $DEFAULT_FLAGS |= GLOB_NOCASE(); } # Autoload methods go after =cut, and are processed by the autosplit program. sub bsd_glob { my ($pat,$flags) = @_; $flags = $DEFAULT_FLAGS if @_ < 2; return doglob($pat,$flags); } # File::Glob::glob() is deprecated because its prototype is different from # CORE::glob() (use bsd_glob() instead) sub glob { goto &bsd_glob; } ## borrowed heavily from gsar's File::DosGlob my %iter; my %entries; sub csh_glob { my $pat = shift; my $cxix = shift; my @pat; # glob without args defaults to $_ $pat = $_ unless defined $pat; # extract patterns $pat =~ s/^\s+//; # Protect against empty elements in $pat =~ s/\s+$//; # things like < *.c> and <*.c >. # These alone shouldn't trigger ParseWords. if ($pat =~ /\s/) { # XXX this is needed for compatibility with the csh # implementation in Perl. Need to support a flag # to disable this behavior. require Text::ParseWords; @pat = Text::ParseWords::parse_line('\s+',0,$pat); } # assume global context if not provided one $cxix = '_G_' unless defined $cxix; $iter{$cxix} = 0 unless exists $iter{$cxix}; # if we're just beginning, do it all first if ($iter{$cxix} == 0) { if (@pat) { $entries{$cxix} = [ map { doglob($_, $DEFAULT_FLAGS) } @pat ]; } else { $entries{$cxix} = [ doglob($pat, $DEFAULT_FLAGS) ]; } } # chuck it all out, quick or slow if (wantarray) { delete $iter{$cxix}; return @{delete $entries{$cxix}}; } else { if ($iter{$cxix} = scalar @{$entries{$cxix}}) { return shift @{$entries{$cxix}}; } else { # return undef for EOL delete $iter{$cxix}; delete $entries{$cxix}; return undef; } } } 1; __END__ #line 466 FILE 1a66b451/IO.pm a#line 1 "/usr/lib/perl5/5.8.0/i386-linux-thread-multi/IO.pm" # package IO; use XSLoader (); use Carp; $VERSION = "1.20"; XSLoader::load 'IO', $VERSION; sub import { shift; my @l = @_ ? @_ : qw(Handle Seekable File Pipe Socket Dir); eval join("", map { "require IO::" . (/(\w+)/)[0] . ";\n" } @l) or croak $@; } 1; __END__ #line 47 FILE 802dac5b/IO/File.pm #line 1 "/usr/lib/perl5/5.8.0/i386-linux-thread-multi/IO/File.pm" # package IO::File; #line 105 use 5.006_001; use strict; our($VERSION, @EXPORT, @EXPORT_OK, @ISA); use Carp; use Symbol; use SelectSaver; use IO::Seekable; use File::Spec; require Exporter; @ISA = qw(IO::Handle IO::Seekable Exporter); $VERSION = "1.09"; @EXPORT = @IO::Seekable::EXPORT; eval { # Make all Fcntl O_XXX constants available for importing require Fcntl; my @O = grep /^O_/, @Fcntl::EXPORT; Fcntl->import(@O); # first we import what we want to export push(@EXPORT, @O); }; ################################################ ## Constructor ## sub new { my $type = shift; my $class = ref($type) || $type || "IO::File"; @_ >= 0 && @_ <= 3 or croak "usage: new $class [FILENAME [,MODE [,PERMS]]]"; my $fh = $class->SUPER::new(); if (@_) { $fh->open(@_) or return undef; } $fh; } ################################################ ## Open ## sub open { @_ >= 2 && @_ <= 4 or croak 'usage: $fh->open(FILENAME [,MODE [,PERMS]])'; my ($fh, $file) = @_; if (@_ > 2) { my ($mode, $perms) = @_[2, 3]; if ($mode =~ /^\d+$/) { defined $perms or $perms = 0666; return sysopen($fh, $file, $mode, $perms); } if (! File::Spec->file_name_is_absolute($file)) { $file = File::Spec->catfile(File::Spec->curdir(),$file); } $file = IO::Handle::_open_mode_string($mode) . " $file\0"; } open($fh, $file); } 1; FILE 1112dc24/IO/Handle.pm #line 1 "/usr/lib/perl5/5.8.0/i386-linux-thread-multi/IO/Handle.pm" package IO::Handle; #line 249 use 5.006_001; use strict; our($VERSION, @EXPORT_OK, @ISA); use Carp; use Symbol; use SelectSaver; use IO (); # Load the XS module require Exporter; @ISA = qw(Exporter); $VERSION = "1.21_00"; $VERSION = eval $VERSION; @EXPORT_OK = qw( autoflush output_field_separator output_record_separator input_record_separator input_line_number format_page_number format_lines_per_page format_lines_left format_name format_top_name format_line_break_characters format_formfeed format_write print printf getline getlines printflush flush SEEK_SET SEEK_CUR SEEK_END _IOFBF _IOLBF _IONBF ); ################################################ ## Constructors, destructors. ## sub new { my $class = ref($_[0]) || $_[0] || "IO::Handle"; @_ == 1 or croak "usage: new $class"; my $io = gensym; bless $io, $class; } sub new_from_fd { my $class = ref($_[0]) || $_[0] || "IO::Handle"; @_ == 3 or croak "usage: new_from_fd $class FD, MODE"; my $io = gensym; shift; IO::Handle::fdopen($io, @_) or return undef; bless $io, $class; } # # There is no need for DESTROY to do anything, because when the # last reference to an IO object is gone, Perl automatically # closes its associated files (if any). However, to avoid any # attempts to autoload DESTROY, we here define it to do nothing. # sub DESTROY {} ################################################ ## Open and close. ## sub _open_mode_string { my ($mode) = @_; $mode =~ /^\+?(<|>>?)$/ or $mode =~ s/^r(\+?)$/$1</ or $mode =~ s/^w(\+?)$/$1>/ or $mode =~ s/^a(\+?)$/$1>>/ or croak "IO::Handle: bad open mode: $mode"; $mode; } sub fdopen { @_ == 3 or croak 'usage: $io->fdopen(FD, MODE)'; my ($io, $fd, $mode) = @_; local(*GLOB); if (ref($fd) && "".$fd =~ /GLOB\(/o) { # It's a glob reference; Alias it as we cannot get name of anon GLOBs my $n = qualify(*GLOB); *GLOB = *{*$fd}; $fd = $n; } elsif ($fd =~ m#^\d+$#) { # It's an FD number; prefix with "=". $fd = "=$fd"; } open($io, _open_mode_string($mode) . '&' . $fd) ? $io : undef; } sub close { @_ == 1 or croak 'usage: $io->close()'; my($io) = @_; close($io); } ################################################ ## Normal I/O functions. ## # flock # select sub opened { @_ == 1 or croak 'usage: $io->opened()'; defined fileno($_[0]); } sub fileno { @_ == 1 or croak 'usage: $io->fileno()'; fileno($_[0]); } sub getc { @_ == 1 or croak 'usage: $io->getc()'; getc($_[0]); } sub eof { @_ == 1 or croak 'usage: $io->eof()'; eof($_[0]); } sub print { @_ or croak 'usage: $io->print(ARGS)'; my $this = shift; print $this @_; } sub printf { @_ >= 2 or croak 'usage: $io->printf(FMT,[ARGS])'; my $this = shift; printf $this @_; } sub getline { @_ == 1 or croak 'usage: $io->getline()'; my $this = shift; return scalar <$this>; } *gets = \&getline; # deprecated sub getlines { @_ == 1 or croak 'usage: $io->getlines()'; wantarray or croak 'Can\'t call $io->getlines in a scalar context, use $io->getline'; my $this = shift; return <$this>; } sub truncate { @_ == 2 or croak 'usage: $io->truncate(LEN)'; truncate($_[0], $_[1]); } sub read { @_ == 3 || @_ == 4 or croak 'usage: $io->read(BUF, LEN [, OFFSET])'; read($_[0], $_[1], $_[2], $_[3] || 0); } sub sysread { @_ == 3 || @_ == 4 or croak 'usage: $io->sysread(BUF, LEN [, OFFSET])'; sysread($_[0], $_[1], $_[2], $_[3] || 0); } sub write { @_ >= 2 && @_ <= 4 or croak 'usage: $io->write(BUF [, LEN [, OFFSET]])'; local($\) = ""; $_[2] = length($_[1]) unless defined $_[2]; print { $_[0] } substr($_[1], $_[3] || 0, $_[2]); } sub syswrite { @_ >= 2 && @_ <= 4 or croak 'usage: $io->syswrite(BUF [, LEN [, OFFSET]])'; if (defined($_[2])) { syswrite($_[0], $_[1], $_[2], $_[3] || 0); } else { syswrite($_[0], $_[1]); } } sub stat { @_ == 1 or croak 'usage: $io->stat()'; stat($_[0]); } ################################################ ## State modification functions. ## sub autoflush { my $old = new SelectSaver qualify($_[0], caller); my $prev = $|; $| = @_ > 1 ? $_[1] : 1; $prev; } sub output_field_separator { carp "output_field_separator is not supported on a per-handle basis" if ref($_[0]); my $prev = $,; $, = $_[1] if @_ > 1; $prev; } sub output_record_separator { carp "output_record_separator is not supported on a per-handle basis" if ref($_[0]); my $prev = $\; $\ = $_[1] if @_ > 1; $prev; } sub input_record_separator { carp "input_record_separator is not supported on a per-handle basis" if ref($_[0]); my $prev = $/; $/ = $_[1] if @_ > 1; $prev; } sub input_line_number { local $.; my $tell = tell qualify($_[0], caller) if ref($_[0]); my $prev = $.; $. = $_[1] if @_ > 1; $prev; } sub format_page_number { my $old = new SelectSaver qualify($_[0], caller) if ref($_[0]); my $prev = $%; $% = $_[1] if @_ > 1; $prev; } sub format_lines_per_page { my $old = new SelectSaver qualify($_[0], caller) if ref($_[0]); my $prev = $=; $= = $_[1] if @_ > 1; $prev; } sub format_lines_left { my $old = new SelectSaver qualify($_[0], caller) if ref($_[0]); my $prev = $-; $- = $_[1] if @_ > 1; $prev; } sub format_name { my $old = new SelectSaver qualify($_[0], caller) if ref($_[0]); my $prev = $~; $~ = qualify($_[1], caller) if @_ > 1; $prev; } sub format_top_name { my $old = new SelectSaver qualify($_[0], caller) if ref($_[0]); my $prev = $^; $^ = qualify($_[1], caller) if @_ > 1; $prev; } sub format_line_break_characters { carp "format_line_break_characters is not supported on a per-handle basis" if ref($_[0]); my $prev = $:; $: = $_[1] if @_ > 1; $prev; } sub format_formfeed { carp "format_formfeed is not supported on a per-handle basis" if ref($_[0]); my $prev = $^L; $^L = $_[1] if @_ > 1; $prev; } sub formline { my $io = shift; my $picture = shift; local($^A) = $^A; local($\) = ""; formline($picture, @_); print $io $^A; } sub format_write { @_ < 3 || croak 'usage: $io->write( [FORMAT_NAME] )'; if (@_ == 2) { my ($io, $fmt) = @_; my $oldfmt = $io->format_name($fmt); CORE::write($io); $io->format_name($oldfmt); } else { CORE::write($_[0]); } } # XXX undocumented sub fcntl { @_ == 3 || croak 'usage: $io->fcntl( OP, VALUE );'; my ($io, $op) = @_; return fcntl($io, $op, $_[2]); } # XXX undocumented sub ioctl { @_ == 3 || croak 'usage: $io->ioctl( OP, VALUE );'; my ($io, $op) = @_; return ioctl($io, $op, $_[2]); } # this sub is for compatability with older releases of IO that used # a sub called constant to detemine if a constant existed -- GMB # # The SEEK_* and _IO?BF constants were the only constants at that time # any new code should just chech defined(&CONSTANT_NAME) sub constant { no strict 'refs'; my $name = shift; (($name =~ /^(SEEK_(SET|CUR|END)|_IO[FLN]BF)$/) && defined &{$name}) ? &{$name}() : undef; } # so that flush.pl can be deprecated sub printflush { my $io = shift; my $old = new SelectSaver qualify($io, caller) if ref($io); local $| = 1; if(ref($io)) { print $io @_; } else { print @_; } } 1; FILE 4c4336c6/IO/Seekable.pm #line 1 "/usr/lib/perl5/5.8.0/i386-linux-thread-multi/IO/Seekable.pm" # package IO::Seekable; #line 96 use 5.006_001; use Carp; use strict; our($VERSION, @EXPORT, @ISA); use IO::Handle (); # XXX we can't get these from IO::Handle or we'll get prototype # mismatch warnings on C<use POSIX; use IO::File;> :-( use Fcntl qw(SEEK_SET SEEK_CUR SEEK_END); require Exporter; @EXPORT = qw(SEEK_SET SEEK_CUR SEEK_END); @ISA = qw(Exporter); $VERSION = "1.08_00"; $VERSION = eval $VERSION; sub seek { @_ == 3 or croak 'usage: $io->seek(POS, WHENCE)'; seek($_[0], $_[1], $_[2]); } sub sysseek { @_ == 3 or croak 'usage: $io->sysseek(POS, WHENCE)'; sysseek($_[0], $_[1], $_[2]); } sub tell { @_ == 1 or croak 'usage: $io->tell()'; tell($_[0]); } 1; FILE 4858ef62/XSLoader.pm F#line 1 "/usr/lib/perl5/5.8.0/i386-linux-thread-multi/XSLoader.pm" # Generated from XSLoader.pm.PL (resolved %Config::Config value) package XSLoader; # And Gandalf said: 'Many folk like to know beforehand what is to # be set on the table; but those who have laboured to prepare the # feast like to keep their secret; for wonder makes the words of # praise louder.' # (Quote from Tolkien sugested by Anno Siegel.) # # See pod text at end of file for documentation. # See also ext/DynaLoader/README in source tree for other information. # # Tim.Bunce@ig.co.uk, August 1994 $VERSION = "0.01"; # avoid typo warning # enable debug/trace messages from DynaLoader perl code # $dl_debug = $ENV{PERL_DL_DEBUG} || 0 unless defined $dl_debug; my $dl_dlext = 'so'; package DynaLoader; # No prizes for guessing why we don't say 'bootstrap DynaLoader;' here. # NOTE: All dl_*.xs (including dl_none.xs) define a dl_error() XSUB boot_DynaLoader('DynaLoader') if defined(&boot_DynaLoader) && !defined(&dl_error); package XSLoader; 1; # End of main code # The bootstrap function cannot be autoloaded (without complications) # so we define it here: sub load { package DynaLoader; my($module) = $_[0]; # work with static linking too my $b = "$module\::bootstrap"; goto &$b if defined &$b; goto retry unless $module and defined &dl_load_file; my @modparts = split(/::/,$module); my $modfname = $modparts[-1]; my $modpname = join('/',@modparts); my $modlibname = (caller())[1]; my $c = @modparts; $modlibname =~ s,[\\/][^\\/]+$,, while $c--; # Q&D basename my $file = "$modlibname/auto/$modpname/$modfname.$dl_dlext"; # print STDERR "XSLoader::load for $module ($file)\n" if $dl_debug; my $bs = $file; $bs =~ s/(\.\w+)?(;\d*)?$/\.bs/; # look for .bs 'beside' the library goto retry if not -f $file or -s $bs; my $bootname = "boot_$module"; $bootname =~ s/\W/_/g; @dl_require_symbols = ($bootname); my $boot_symbol_ref; if ($^O eq 'darwin') { if ($boot_symbol_ref = dl_find_symbol(0, $bootname)) { goto boot; #extension library has already been loaded, e.g. darwin } } # Many dynamic extension loading problems will appear to come from # this section of code: XYZ failed at line 123 of DynaLoader.pm. # Often these errors are actually occurring in the initialisation # C code of the extension XS file. Perl reports the error as being # in this perl code simply because this was the last perl code # it executed. my $libref = dl_load_file($file, 0) or do { require Carp; Carp::croak("Can't load '$file' for module $module: " . dl_error()); }; push(@dl_librefs,$libref); # record loaded object my @unresolved = dl_undef_symbols(); if (@unresolved) { require Carp; Carp::carp("Undefined symbols present after loading $file: @unresolved\n"); } $boot_symbol_ref = dl_find_symbol($libref, $bootname) or do { require Carp; Carp::croak("Can't find '$bootname' symbol in $file\n"); }; push(@dl_modules, $module); # record loaded module boot: my $xs = dl_install_xsub("${module}::bootstrap", $boot_symbol_ref, $file); # See comment block above return &$xs(@_); retry: require DynaLoader; goto &DynaLoader::bootstrap_inherit; } __END__ #line 139 FILE 50e023d6/auto/Cwd/Cwd.so 4ELF 4 % 4 ( C K E J : # >