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ԃ\ŅƄ\Ņ\Ņ Ƅ ?\Ã?7rfh FN 7( e7( m  ?\ƅ}~ }~ ɶŲ?rfɒsubs.pm}~?Ƅ<2Y\ƅ? 7( 6?7( \ԃ\ŅƄ\Ņ\Ņ ?Ƃ ?\Ã7dPl7( X7( ?( 2 \ƅ}~ ?}~ ʬ̠s?yslog.ps܁=Zl}~ Ƅ<2\ƅ ?? 7(`7(J8 \ԃ\@?Ƅ\Ņ\Ņ Ƅ ?\Ã?7dPl7(7(  \?ƅ}~  }~ ,"??tainted.pl}~"?Ƅ<2저\ƅ? 7(?h7( \ԃ\ŅƄ\Ņ\Ņ ?t1*Ƅ ?\Ã7dPl7((7("?" \ƅ}~ "}~? h^${Dtermca?p.pl}~$Ƅ<2S\ƅ ?? 7(7(g \ԃ\Ņ?Ƅ\Ņ\Ņ Ƅ ?\Ã?7dPl[7(7( $ \?ƅ}~ $}~ ڨ֚du [,X?ֻڄtimelocal.pl}~+Ƅ), GDBM, SDBM >(which {+׆4Ӣ;is always ther?e--it comes with Perl), and finally ODBM. ?This way old progra?ms that used to use NDBM via dbmopen() can s,till do so, but ne?w ones can reorder @ISA: >BEGIN { @AnyDBM_File::ISA = qw(DB_?File GDBM_File NDBM_File) } use AnyDBM_File; ?Having multip?le DBM implementations makes it trivial to copy database forma?ts: 'use POSIX; use NDBM_File; use DB_File; 9tie %newhash, 'DB_Fi?le', $new_filename, O_CREAT|O_RDWR; 1tie %oldhash, 'NDBM_Fil?e', $old_filename, 1, 0; ?%newhash = %|<(=Ѽzoldhash; =head2 DBM Co?mparisons Here's a partial 1table of features the different pa?ckages offer: odbm ndbm sdbm gdbm bsd-db  - ?- - - - Linkage comes w/ perl yes yes yes yes ? yes Src comes w/ perl no no yes no no Comes w/ m?any unix os yes yes[0] no no no Builds ok on !unix ?? ? yes yes ? Code Size ? ? small big big Database ?Size ? ? small big? ok[1] Speed ? ? slow ok? fast FTPable no no yes}Țf{e D yes yes Easy to build N/?A N/A yes yes ok[2] Size limits 1k 4k 1k[3] ?none none Byte-order independent no no no no yes L?icensing restrictions ? ? no yes no ?=over 4 =item [?0] on mixed universe machines, may be in the ?bsd compat libr?ary, which is often shunned. =item [1] Can be? trimmed if yo?u compile for one access method. =item [2] See? L.  Require?s symbolic links. =item [3] By defaul?t, but can be redefi?ned. =back =head1 SE~rdK3rE ALSO dbm(3), ndbm(3), DB_File(3) =cut }~L 55a@@ك <.( b/O@@2#??? 2#}~ ?~ʹ v$_? 2#~ʹ z ak8dP =P ? 2#&&_D]yc<~ʹ *??package AutoLoader; ?use vars qw(@EXPORT @EXPORT_OK); my $is_dosish; my $is_vms; ?BEGIN { require Exporter; @EXPORT = (); @EXPORT_OK = qw(AUTOLO?AD); ?$is_dosish = $^O eq 'dos' || $^O eq 'os2' || $^O eq 'MS?Win32'; &$is_vms = $^O eq 'VMS'; } AUTOLOAD { my $name; ? $# Braces used to preserve $1 et al. ?{ # Try to find the a?utoloaded file from the package-qualified? # name of the sub. ?e.g., if the sub needed is3}a # Getopt::Long9::GetOptions(), then? $INC{Getopt/Long.pm} is # something? like '/usr/lib/perl5/Get?opt/Long.pm', and the # autoload file? is '/usr/lib/perl5/auto?/Getopt/Long/GetOptions.al'. # # Howe?ver, if @INC is a relative path?, this might not work. If, # f?or example, @INC = ('lib'), th?en $INC{Getopt/Long.pm} is # 'li?b/Getopt/Long.pm', and we wan?t to require # 'auto/Getopt/Long/?GetOptions.al' (without the ?leading 'lib'). # In this case, we? simple prepend the 'auto/'? and let the # CF'qͅ7i take care? of the searching for us. ? my ($pkg,$func) = $AUTOLOAD =~ /(.*)::([^:]?+)$/; $pkg =~ s?#::#/#g; if (defined($name=$INC{"$pkg.pm"})) { 3$name =~ s?#^(.*)$pkg\.pm$#$1auto/$pkg/$func.al#; 3# 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 searching ># (and failing) to find ?the 'lib/auto/foo/bar.al' because it ?# looked for 'lib/lib/?auto/foogSj S/bar.al', given @INC = ('lib').  if (-r $name) { ? unless ($name =~ m|^/|) { if ($is_dosish) { (unless ?($name =~ m{^([a-z]:)?[\\/]}i) { $name = "./$name"; } ? } elsif ($is_vms) { # X todo by VMSmiths $name = "./?$name"; } else { $name = "./$name"; } } ?} else { $name = undef; } } unless (defined $name)? { ## let C do the searching $name = "auto/$AUT?OLOAD.al"; $name =~ s#::#/#g; } } my $save = $@; -Yu'Pw ?eval { local $SIG{__DIE__}; require $name }; if ($@) { if (?substr($AUTOLOAD,-9) eq '::DESTROY') { *$AUTOLOAD = sub {}?; } else { ?# The load might just have failed because the f?ilename was too  ?# long for some old SVR3 systems which treat long ?names as errors. ?# If we can succesfully truncate a long n?ame 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 ($name =i!Ɔ,~ s/(\w{1?2,})\.al$/substr($1,0,11).".al"/e){ eval "{local $SIG{__DIE__?};require $name}; } ?if ($@){ $@ =~ s/ at .*\n//; m?y $error = $@; require Carp; Carp::croak($error); } }? } $@ = $save; !goto &$AUTOLOAD; } sub import { my $pkg = s?hift; my $callpkg = caller; # 6# Export symbols, but n?ot by accident of inheritance. # >Exporter::export $pkg, ?$callpkg, @_ if $pkg eq 'AutoLoader'; # ?# Try to find th?e autosplit index file. Eg., if the call pac >irkage 2# is POSI?X, then $INC{POSIX.pm} is something like # '/usr/local/lib/p?er1l5/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} i?s 'lib/POSIX.pm', and we want to require 9# 'auto/POSIX/autos?plit.ix' (without the leading 'lib'). # &(my $calldir = $?callpkg) =~ s#::#/#g; #my $path = P* !$INC{$calldir . '.pm'}; :?if (defined($path)) { # Try absolute path name. $path =~? s#^?(.*)$calldir\.pm$#$1auto/$calldir/autosplit.ix#; eval { re?qui?re $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); } ?} } 1; __END__ ? =head1 NAME AutoLoader - load subroutines o nly on demand =h?ead1 SYNOPSIS package FlDj}oo; use AutoLoader 'AUTOLOAD'; *?# import the default AUTOLOAD subroutine package Bar; u?se AutoLoader; (# don't import AUTOLOAD, define our own sub? AUTOLOAD { . $AutoLoader::AUTOLOAD = "."; goto &Au?toLoader::AUTOLOAD; ?} =head1 DESCRIPTION The B module ?works with the ?B module and the C<__END__> token to? defer the loadi?ng of some subroutines until they are used rat?her than loading ?them all at once. To use B, the ?author of a moduleqm(<(8%h? has to place the definitions of subroutines? to be autoloaded a fter an C?<__END__> token. (See L?.) The B module ca?n then be run manually to extrac?t the definitions into individu?al files F. ?B implements an AUTO?LOAD subroutine. When an undefined su?broutine in is called in ?a client module of B, B's AUTOLOAD subr?outine attempts to locate the subrou?tine in a file with a name ?related to the location of the file? from whiI0˞m'iJch the client modul?e was read. As an example, if F is located in F, B will look for perl subroutine?s B in F, where th?e C<.al> file has the ?same name as the subroutine, sans package?. If such a file exists, AUT?OLOAD will read and evaluate it, t?hus (presumably) defining th?e needed subroutine. AUTOLOAD will? then C the newly def?ined subroutine. Once this process ?completes for a given funt?vLȌMion, it is defined, so future calls t?o the subroutine will byp?ass the AUTOLOAD mechanism. =head2 Subroutine? Stubs In orde?r for object method lookup and/or prototype chec?king to operat?e correctly even when methods have not yet been d?efined it is ?necessary to "forward declare" each subroutine (as? in C). ?See L. Such forward de?claration creates "?subroutine stubs", which are place holders w?ith no code. The ?AutoSplit and B modules automate ?the creatӷO%X5pcion of f?orward declarations. The AutoSplit module cre?ates an 'index' ?file containing forward declarations of all the AutoSpl?it sub?routines. When the AutoLoader module is 'use'd it loads ?these? declarations into its callers package. Because of this m?echa?nism it is important that B is always Cd a?nd not Cd. =head2 Using B's AUTOLOAD Subr?outine In? order to use B's AUTOLOAD subroutine you I ?explicitly import it: ?use AutoLoader 'AUTONKoLOAD'; =head2 Ov?erriding B's A?UTOLOAD Subroutine Some modules, ma?inly extensions, provide th#eir own AUTOLOAD subroutines. They ??typically need to check for some special cases (such as consta?n?ts) and then fallback to B's AUTOLOAD for the res?t.? Such modules should I import B's AUTOLOAD su?brou?tine. Instead, they should define their own AUTOLOAD subroutin?es along these lines: use AutoLoader; use Carp; sub ?AUTOLOAD { my $constname; &($con9^$Jqstname = $AUTOLOAD) =~ s/.?*:://; 0my $val = constant($constname, @_ ? $_[0] : 0); if? ($! != 0) { if ($! =~ /Invalid/) { #$AutoLoader::AUTOLOA?D = $AUTOLOAD; goto &AutoLoader::AUTOLOAD; } else { ?9croak "Your vendor has not defined constant $constname"; } ? ?} *$AUTOLOAD = sub { $val }; # same as: eval "sub $AUTOLOAD { $val? }"; goto &$AUTOLOAD; ?} If any module's own AUTOLOAD sub?routine has no need to fallb?ack to the AutoLoader's AUTOLOAD s?ubroutine (because it doesn''su9ޯs3t; have any AutoSplit subroutines),? then that module should n?ot use B at all. =head2? Package Lexicals Package ?lexicals declared with C in the? main block of a package usi?ng B will not be visib?le to auto-loaded subroutines?, due to the fact that the given ?scope ends at the C<__END__> m?arker. A module using such variables as? package globals will n?ot work properly under the B. The C pragma (?see L) may be used in ?such situations as q[& F'an alt?ernative to explicitly qualifying all? globals with the package namespac?e. Variables pre-declared ?with this pragma will be visible to ?any autoloaded routines (b?ut will not be invisible outside the ?package, unfortunately). ? =head2 B vs. B The B is ?similar in purpose to B: bo?th delay the loading of subrout?ines. B uses the C marker rather than C?<__END__>. While this avoids the ?use of a hierarchy of disk fi?les and th'{!6F\e associated open/close ?for each routine loaded, B suffers a startup speed disadvan?tage in the one-ti?me parsing of the lines after C<__DATA__>, af?ter which routine?s are cached. B can also handle m?ultiple packages? in a file. B only reads code as i?t is requested,? and in many cases should be faster, but require?s a machanism like B be used to create the individua?l files. L will invoke B autom?atically if B is used in a module source file. =he?ad1 CAVEATS AutoLo?aders prior to Perl 5.002 had a slightly different i?nterface.? Any old modules which use B should be ch?anged to? the new calling style. Typically this just means chan?ging a ?require to a use, adding the explicit C<'AUTOLOAD'> impo?rt if ?needed, and removing B from C<@ISA>. On syst?ems with rest?rictions on file name length, the file correspondi?ng to a subr?outine may have a shorter name that the routine its?elf.AMQR This ?can lead to conflicting file names. The I package ?warns of these potential conflicts when used to split a modul??e. AutoLoader may fail to find the autosplit files (or even fi??nd the wrong ones) in cases where C<@INC> contains relative pa?t?hs, B the program does C. =head1 SEE ALSO Loader> - an autoloader that doesn't use external files. =cut ??O7&bMb]9}~ 55a@@ك <.( =@@??? }~ ?~ʹ A,$_? ~ʹ _a ak8dL =P ? 2pi77 <~ʹ _??package AutoSplit; ?use Exporter (); use Config qw(%Config); us?e Carp qw(carp); us?e File::Basename (); use File::Path qw(mkpath); use strict; use vars q?w( "$VERSION @ISA @EXPORT @EXPORT_OK :$Verbose $Keep $Max?len $CheckForAutoloader $CheckModTime ?); $VERSION = "1.030?2"; @ISA = qw(Exporter); @EXPORT = qw(&aut?osplit &autosplit_li?b_modules); @EXPORT_OK = qw($Verbose $Keep ?$Maxlen $CheckForAu?toloader $Check&" RmModTime); =head1 NAME AutoS?plit - split a pac?kage for autoloading =head1 SYNOPSIS autosp?lit($file, $dir?, $keep, $check, $modtime); autosplit_lib_modu?les(@modules);? =head1 DESCRIPTION This function will split up? your program into fi?les that the AutoLoader module can handle.? It is used by both ?the standard perl libraries and by the Make?Maker utility, to a?utomatically configure libraries for autoloa?ding. The C interface splits the specified file int?o a hierarchy ro?oted aqWZ”{$Ot the directory C<$dir>. It creates dire?ctories as neede?d to reflect class hierarchy, and creates the file F. This file acts as both forward declaration of all ?packa?ge routines, and as timestamp for the last update of the h?ierarchy. T?he remaining three arguments to C govern? other opti?ons to the autosplitter. =over 2 =item $keep If t?he third a?rgument, I<$keep>, is false, then any pre-existing C fil?es in the autoload directory are removed if they are n?o longť[?kS!zer? part of the module (obsoleted functions). $keep defaul?ts to 0?. =item $check The fourth argument, I<$check>, instructs C to check the module currently being split to ensure ?tha?t it does include a C specification for the AutoLoader mod?ule?, and skips the module if AutoLoader is not detected. $check? d?efaults to 1. =item $modtime Lastly, the I<$modtime> argume?n?t specifies that C is to check the modification tim??e of the module against that of the C hXgMXF@file, and o??nly split the module if it is newer. $modtime defaults to 1. ?=?back Typical use of AutoSplit in the perl MakeMaker utility ?is via the? command-line with: perl -e 'use AutoSplit; autos?plit($ARGV[0?], $ARGV[1], 0, 1, 1)' Defined as a Make macro, it is inv?oked ?with file and directory arguments; C will spli?t the ?specified file into the specified directory and delete o?bsolete? C<.al> files, after checking first that the module doe?s use th?e AutoLoader, and ensuring that th%ҴOve module is not alre?ady curre?ntly split in its current form (the modtime test). T?he C form is used in the building of pe?rl. It takes as inp?ut a list of files (modules) that are assu?med to reside in a di?rectory B relative to the current directory.? Each file is ?sent to the autosplitter one at a time, to be s?plit into the d?irectory B. In both usages of the au?tosplitter, only? subroutines defined following the perl I<__EN?D__> token are sp?lit out into sepHm KzC arate files. Some routines ma?y be placed prior ?to this marker to force their immediate load?ing and parsing. =?head2 Multiple packages As of version 1.01? of the AutoSplit module it ?is possible to have multiple pack?ages within a single file. Bot)h of the following cases are supported: ? package NAME; __END__ sub A { . } package NAME?::option1; sub B { . } package NAME::option2; sub ?B { . } package NAME; __END__ sub A { . } ?sub NAME::option1::B { P{Hv3. } sub NAME::option2::B { .? ?} =head1 DIAGNOSTICS C will inform the user if it?? is necessary to create the top-level directory specified in th? e invocation. It is preferred th?at the script or installation? process that invokes C? have created the full directory pat?h ahead of time. This warni?ng may indicate that the module is ?being split into an incorrec?t path. C will warn th?e user of all subroutines who?se name causes potential file nam?ing conflicts onY^ machines with? drastically limited (8 characte?rs or less) file name length. S?ince the subroutine name is use?d as the file name, these warnin?gs can aid in portability to s?uch systems. Warnings are issued and the? file skipped if C cannot locate either the I<__END_?_> marker or a "package Nam?e;"-style specification. C will also emit general ?diagnostics for inability to create d?irectories or files. =cu?t # for portability warn about names ?longer than $maxlen $Max?len = &L;8; # 8 for dos, 11 (14-".al") fo?r SYSVR3 $Verbose = 1; ?# 0=none, 1=minimal, 2=list .al files $Keep ?= 0; $CheckForAu?toloader = 1; $CheckModTime = 1; my $IndexFile? = "autosplit.i?x"; # file also serves as timestamp my $maxflen =? 255; $maxfl?en = 14 if $Config{'d_flexfnam'} ne 'define'; if (defined (&Dos::UseLF?N)) { ?$maxflen = Dos::UseLFN() ? 255 : 11; } my $Is_VMS = ($?^O eq 'VMS'); sub autosplit{ 0my($file, $autodir, $keep, ?$ckal, $ckmt) = @_; # $file 3- the perl source file to be 2y!s?plit (after __END__) # $autodir - the ".+/auto" dir below w?hich to write split subs # Handle optional flags: $$keep =? $Keep unless defined $keep; 2$ckal = $CheckForAutoloader unl?ess defined $ckal; $ckmt = $CheckModTime unless defined $ck?mt; 7autosplit_file($file, $autodir, $keep, $ckal, $ckmt); } ?# This? function is used during perl building/installation # ./m9inipe?rl -e 'use AutoSplit; autosplit_lib_modules(@ARGV)' . sub au?tosplit_lib_modules{ +my(@modules) = @_; # list of Df92ɕ4qModule nam?es ?while(defined($_ = shift @modules)){ s#::#/#g; # incase? specif?ied as ABC::XYZ s|\\|/|g; # bug in ksh OS/2 s#^lib/#?#; # inc?ase specified as lib/*.pm if ($Is_VMS && /[:>\]]/) { ?# may nee#d to convert VMS-style filespecs "my ($dir,$name)? = (/(.*])(.*)/); $dir =~ s/.*lib[\.\]]//; $dir =~ s#[\.\]]#/#g?; >$_ = $dir . $name; } autosplit_file("lib/$_", "lib/auto?", ,$Keep, $CheckForAutoloader, $CheckModTime); } 0; ?} *# private functions sub autosplit_file Y]R z{ ?my($filename, ?$autodir, $keep, $check_for_autoloader, $check_mod_time) = @_?; my(@outfiles); local($_); local($/) = "\n"; # wh?ere to write output files $autodir ||= "lib/auto"; $if ($I?s_VMS) { ($autodir = VMS::Fil?espec::unixpath($autodir)) =~ s|?/$||; $filename = VMS::Filespe'c::unixify($filename); # may have dirs ? } ?unless (-d $autodir){ mkpath($autodir,0,0755); # We s?hould ne?ver need to create the auto dir # here. installperl (?or simila?r) should have done # itaVuj. Expecting it to exist is a? valuable ?sanity check against # autosplitting into some rand?om director?y by mistake. print "Warning: AutoSplit had to cre?ate top-level " . "$autodir unexpectedly.\n"; } ## a?llow just a package name to be used 4$filename .= ".pm" unle?ss ($filename =~ m/\.pm$/); ?open(IN, "<$filename") or die "AutoSpli?t: Can't open $filename: $!\n"; )my($pm_mod_time) = (stat($f?ilename))[9]; my($autoloader_seen) = 0; my($in_pod) = 0; ? 3my($def_package,$last_p,(dcackage,$this_package,$fnr); ?while ?() { # Skip pod text. $fnr++; $in_pod = 1 if /^=/;? $in?_pod = 0 if /^=cut/; next if ($in_pod || /^=cut/); # re?cord? last package name seen $def_package = $1 if (m/^\s*packag!e\s?+([\w:]+)\s*;/); ++$autoloade?r_seen if m/^\s*(use|require)\s+?AutoLoader\b/; ++$autoloader_s:een if m/\bISA\s*=.*\bAutoLoader\b/; l?ast if /^__END__/; } ?if ($check_for_autoloader && !$autol?oader_seen){ print "AutoSp.lit skipped $filename: no AutoLoade?r used\n" if yU($Verbose>=2); return 0; } 0$_ or die "C?an't find __END__ in $filename\n"; ?$def_package or die "Can?'t find 'package Name;' in $filename\n"; +my($modpname) = _?modpname($def_package); <# this _has_ to match so we have a? reasonable timestamp file ?die "Package $def_package ($modp?name.pm) does not ". "match filename $filename" /unless ($filename? =~ m/\Q$modpname.pm\E$/ or )($^O eq 'dos') or ($^O eq 'MSW?in32') or ,$Is_VMS && $filename =~ m/$modpname.pm/i); 5my?($al_idx"?qZh$_file) = "$autodir/$modpname/$IndexFile"; ?if ($chec?k_mod_time){ my($al_ts_time) = (stat("$al_idx_file")).[9] || 1?; if ($al_ts_time >= $pm_mod_time){ ?print "AutoSplit skipp?ed ($al_idx_file newer than $filename)\n" if ($Verbose >= 2)?; return u!ndef; # one undef, not a list } } ?print ?"AutoSplitting $filename ($autodir/$modpname)\n" if $Verbose; ?unl?ess (-d "$autodir/$modpname"){ mkpath("$autodir/$modpname",0,?07); } ?# We must try to deal with some SVR3 systems wi36F Ur?th a limit of 14 ?# characters for file names. Sadly we *can?not* simply truncate all ?# file names to 14 characters on t?hese systems because we *must* ?# create filenames which exa?ctly match the names used by AutoLo ader.pm. # This is a pro?blem because) some systems silently truncate the file 9# name?s while others treat long file names as an error. ?my $Is83 = $maxfl?en==11; # plain, case INSENSITIVE dos filenames +my(@subna?mes, $subname, %proto, %package); my @cache = (); J6eHW my $cac?hing = 1; $last_package = ''; ?while () { $fnr++; $i?n_pod = 1 if /^=/; $in_pod = 0 if /?^=cut/; next if ($in_pod ?|| /^=cut/); # the following (tempti?ng) old coding gives big ?troubles if a # cut is forgotten at E"OF: # next if /^=\w/ ..? /^=cut/; # if (/^package\s+([\w:]+)\s*;/) { ?$this_package ?= $def_package = $1; } if (/^sub\s+([\w:]+)(\s*\(.*?\))?/) { ?pri?nt OUT "# end of $last_package\::$subname\n1;\n" if $last_ pa?ckage; $subname = $1; my $proto = $2 X&SZ\DZ|| ''; 4if ($su?bname =~ s/(.*):://){ $this_package = $1; *} else { $thi?s_package = $def_package; } .my $fq_subname = "$this_pac?kage\::$subname"; ($package{$fq_subname} = $this_package; ? $proto{$fq_subname} = $proto; push(@subnames, $fq_subname?); ?my($lname, $sname) = ($subname, substr($subname,0,$maxf?len-3)); '$modpname = _modpname($this_package); mkpath("$autodi?r/$modpname",0,07); .my($lpath) = "$autodir/$modpname/$lna?me.al"; .my($spath) = "$autodir/$V % modpname/$sname.al"; my? $path; 'if (!$Is83 and open(OUT, ">$lpath")){ >$path=$lp?ath; print " writing $lpath\n" if ($Verbose>=2); ?} else ?{ open(OUT, ">$spath") or die "Can't create $spath: $!=\n"; ? $path=$spath; print " writing $spath (with truncate d name)?\n" if ($Verbose>=1); } push(@outfiles, $path); ??print OUT < lc($_) } @outfi?les; } euiEΕj}ilse { ?@outfiles{@outfiles} = @outfiles; } my(%?outdirs,@outdirs);  for (@outfiles) { ?$outdirs{File::Basen?ame::dirname($_)}||=1; } for my $dir (keys %outdirs) { o?pendir(OUTDIR,$dir); ?foreach (sort readdir(OUTDIR)){ next? unless /\.al$/; my($file) = "$dir/$_"; $fil?e = lc $file ?if $Is83 or $Is_VMS; next if $outfiles{$file}; ? print " de?leting $file\n" if ($Verbose>=2); my($deleted,$th?istime); # catch a?ll versions on VMS do { $deleted += ($this?time = unlink $fil?vLBke) } while ($thistime); carp "Unable to del!ete $file: $!" un?less $deleted; } closedir(OUTDIR); } } ?open(TS,?">$al_idx_file") or carp "AutoSplit: unable to create $timesta?mp file ($al_idx_file): $!"; 9print TS "# Index created by Au?toSplit for $filename\n"; print TS "# (file acts as times?tamp)\n"; $last_package = ''; ?for my $fqs (@subnames) { ?my($subname) = $fqs; $subname =~ s//.*:://; print TS "package $packag?e{$fqs};\n" ?unless $last_package eq $package{$fqs};H;4¨0_\ print ?TS "sub $subname4 $proto{$fqs};\n"; $last_package = $package{$?fqs}; } print TS "1;\n"; close(TS); 2_check_unique(?$filename, $Maxlen, 1, @outfiles); "@outfiles; } sub _modpn?ame ($) { my($package) = @_; my $modpname = $package; (?if ($^O eq 'MSWin32') { $modpname =~ s# ::#\\#g; !} else { ? $modpname =~ s#::#/#g; } "$modpname; } sub _check_unique? { /my($filename, $maxlen, $warn, @outfiles) = @_; my(%notuniq) = ?(); my(%shorts) = (); my(@toolong) = grtIJ$>@Uep( %length(Fil?e::Basename::basename($_)) > $maxlen, @outfiles ); ? ?foreach (@toolong){ my($dir) = File::Basename::dirname($_);? m?y($file) = File::Basename::basename($_); my($trunc) = subs?tr($?file,0,$maxlen); $notuniq{$dir}{$trunc} = 1 if $shorts{$d?ir}{$trunc}; $shorts{$dir}{$tr unc} = $shorts{$dir}{$trunc} ?? ("$shorts{$dir}{$trunc}, $file" : $file; } ?if (%notun?iq && $warn){ print "$filename: some names are not unique when " . ? ?"truncated to $maxlen characters:\nE Gw?"; foreach my $dir (sort ?keys %notuniq){ print " directory $dir:\n"; ?foreach my? $trunc (sort keys %{$notuniq{$dir}}) { print " $s,horts{$di?r}{$trunc} truncate to $trunc\n"; } } ?} } 1; __END__ ?# test functions so AutoSplit.pm can be applied to itself: sub? test1 ($) { "test 1\n"; } +sub test2 ($$) { "test 2\n"; } s?ub test3 ($?) { "test 3\n"; } sub testtesttesttest4_1 { "test? 4\n"; } sub ?testtesttesttest4_2 { "duplicate test 4\n"; } sub Just::?Anothe*r::test5 { "another tg 2.Vfest 5\n"; } sub test6 ?{ return jo?in ":", __FILE__,__LINE__; } package Yet::Another::A?utoSplit; ?sub testtesttesttest4_1 ($) { "another test 4\n"; } ?sub testt?esttesttest4_2 ($$) { "another duplicate test 4\n"; } G}~ې 55a@@ك <.( X!@@??dїW? }~ ?~ʹɞ$_? ~ʹɸ ak8d =P ? 99 <~ʹɷƀ(?# B.pm # # 2Copyright (c) 1996, 1997, 1998 Malcolm Beattie #? # ?You may distribute under the terms of either the GNU General Public # ?License or th?e Artistic License, as specified in the README fil?e. # package? B; require DynaLoader; requ-\Sb{ire Exporter; @ISA = qw?(Exporter D?ynaLoader); @EXPORT_OK = qw(byteload_fh byteload_str?ing minus_?c ppname class peekop cast_I32 cstring cchar hash t?hreadsv_n?ames main_root main_start main_cv svref_2object wa-lkoptree? walkoptree_slow walkoptree_exec walk?symtable parents comppa?dlist sv_undef compile_stats timing_in?fo); use strict; @B::SV?::ISA = 'B::OBJECT'; @B::NULL::ISA = 'B?::SV'; @B::PV::ISA = 'B::SV'; @?B::IV::ISA = 'B::SV'; @B::NV::IS?A = 'B::IV'; @B::RV::ISA = 'B:?:SV'; @B::PVIV::ISAWŋm3vOi~c = qw(B::PV B:?:IV); @B::PVNV::ISA = qw(B::P?V B::NV); @B::PVMG::ISA = 'B::PVNV?'; @B::PVLV::ISA = 'B::PVMG'?; @B::BM::ISA = 'B::PVMG'; @B::AV::?ISA = 'B::PVMG'; @B::GV::IS?A = 'B::PVMG'; @B::HV::ISA = 'B::PVM?G'; @B::CV::ISA = 'B::PVMG?'; @B::IO::ISA = 'B::PVMG'; @B::FM::ISA = 'B:?:CV'; @B::OP::I?SA = 'B::OBJECT'; @B::UNOP::ISA = 'B::OP'; @B::?BINOP::ISA = 'B?::UNOP'; @B::LOGOP::ISA = 'B::UNOP'; @B::CONDOP:?:ISA = 'B::UNOP'; @B::?LISTOP::ISA = 'B::BINOP'; @B::SVOP::ISA =? 'B::OP'; @B::GVOP::I?SA = 'B::OuXX 6P'; @B::PVOP::ISA = 'B::OP'; @B:?:CVOP::ISA = 'B::OP'?; @B::LOOP::ISA = 'B::LISTOP'; @B::PMOP::IS?A = 'B::LISTOP'; @B?::COP::ISA = 'B::OP'; @B::SPECIAL::ISA = 'B::OBJECT'; { ?#? Stop "-w" from complaining about the lack of a real B::OBJECT? class *package B::OBJECT; } my $debug; my $op_co(unt = 0; m?y @parents = (); sub debug { my ($class, $value) = @_; $?debug = $value; ?walkoptree_debug($value); } # sub OPf_KIDS; # add t?o .xs for p,erl5.002 sub OPf_KIDS () { 4 } sub class { my $?oA$U?ؐXbj = shift; my $name = ref $obj; $name =~ s/^.*:://; ??return $name; } sub parents { \@parents } # For debugging sub? peekop { my $op = shift; ?return sprintf("%s (0x%x) %s",? class($op), $$op, $op->ppaddr); } sub walkoptree_slow { m?y($op, $method, $level) = @_; $op_count++; # just for stati?stics $level ||= 0; 7warn(sprintf("walkoptree: %d. %s\n", ?$level, peekop($op) if $debug; $op->$method($level); ?if ($$op &?& ($op->flags & OPf_KIDS)) { my $kid; unshift(@pare?ntю{s, $op)?; for ($kid = $op->first; $$kid; $kid = $kid->sibling) { ??walkoptree_slow($kid, $method, $level + 1); } shift @parents;? } } sub compile_stats { ?return "Total number of OPs pr?ocessed: $op_count\n"; } sub tim ing_info { "my ($sec, $min,? $hr) = localtime; my ($user, $sys) = times; /sprintf("%0?2d:%02d:%02d user=$user sys=$sys", >$hr, $min, $sec, $user, ?$sys); } my %symtable; sub savesym { my ($obj, $value) = @_; # ?wa?rn(sprintf("savesym: sym_%x => %s\n", $$obj, $v-B89;alue)); # debug? >$symtable{sprintf("sym_%x", $$obj)} = $value; } sub objsym? { my $obj = shift; ?return $symtable{sprintf("sym_%x", $$?obj)}; } sub walkoptree_exec { my ($op, $method, $level) =? @_; my ($sym, $ppname); my $prefix = " " x $level; ?for (; $$op; $op = $op->next) { , $sym = objsym($op); if (defi?ned($sym)) { print $prefix, "goto $sym\n"; ?return; } ?savesym($op, sprintf("%s (0x%lx)", class($op), $$op?)); $op->$method($?level); $ppname = $op->ppaddr; if ($Mgӓ|Ǚppname4 =~ /^pp_(or|and|m?apwhile|grepwhile|entertry)$/) { #print $prefix, uc($1), " =?> {\n"; 3walkoptree_exec($op->other, $method, $level + 1); ? ?print $prefix, "}\n"; } elsif ($ppname eq "pp_match" || $pp?name eq "pp_subst") { %my $pmreplstart = $op->pmreplstart; ? if ($$pmreplstart) { pr?int $prefix, "PMREPLSTART => {\n"?; walkoptree_exec($pmreplsta3rt, $method, $level + 1); prin?t $prefix, "}\n"; *} } elsif ($ppname eq "pp_substcont") {  $prin?t $prefix, "SUBSTCONT => {\n"œoʘʷ; ?walkoptree_exec($op->other->?pmreplstart, $method, $level + 1);  print $prefix, "}\n"; ? :$op = $op->other; } elsif ($ppname eq "pp_cond_expr") { ?&# pp_cond_expr never returns op_next print $prefix, "TRUE ?=> {\n"; 2walkoptree_exec($op->true, $method, $level + 1); ? print $prefix, "}\n"; $op = $op->false; *redo; } el?sif ($ppname eq "pp_range") { print $prefix, "TRUE => {\n";? 2walkoptree_exec($op->true, $method, $level + 1); 0print $prefix?, "}\n", $prefix, "Fu]I9ALSE => {\n"; 3walkoptree_exec($op->fals?e, $method, $level + 1); >print $prefix, "}\n"; } elsif ($p?pname eq "pp_enterloop") { print $prefix, "REDO => {\n"; ? 4walkoptree_exec($op->redoop, $method, $level + 1); /print ?$prefix, "}\n", $prefix, "NEXT => {\n"; walkoptree_exec($op?->nextop, $method, $level + 1); /print $prefix, "}\n", $pre?fix, "LAST => {\n"; 5walkoptree_exec($op->lastop, $method, ?$level + 1); :print $prefix, "}\n"; } elsif ($ppname eq "pp_subst")? { #my $`槉F8I replstart = $op->pmreplstart; ?if ($$replstart) {? print $prefix, "SUBST => {\n"; walkoptre?e_exec($replstart?, $method, $level + 1); print $prefix, "}\n"; } } } ?} sub walksymtable { /my ($symref, $method, $recurse, $prefi?x) = @_; my $sym; no strict 'vars'; local(*glob); w?hile: (($sym, *glob) = each %$symref) { if ($sym =~ /::$/) { ? $sym = $prefix . $sym; ?if ($sym ne "main::" && &$recurse?($sym)) { walksymtable(\%glob, $method, $recurse, $sym);  } } el?se ydT߯8 { *svref_2object(\*glob)->EGV->$method(); } } } { ?package B::Section; my $output_fh; my %sections;  ??sub new { my ($class, $section, $symtable, $default) = @_; $o??utput_fh ||= FileHandle->new_tmpfile; my $obj = bless [-1, $s?e;ction, $symtable, $default], $class; $sections{$section} = ?$obj; return $obj; }  ?sub get { my ($class, $section?) = @_; return $sections{$section}; } ?sub add { my $s?ection = shift; while (defined($_ = shift)) {  )print $outputD%`3>}_fh "$?section->[1]\t$_\n"; $section->[0]++; } } 9sub index? { my $section = shift; return $section->[0]; } 8sub na?me { my $section = shift; return $section->[1]; } [2]; } ? .sub default { my $section = shift; return $s ection->[3]; ? } ?sub output { my ($section, $fh, $format) = @_; my $?name = $se?ction->name; my $sym = $section->symtable || {}; m?y $default ?= $section->default; seek($output_fh, 0, 0)RކNT^; while (<$ou?tput _fh>) { chomp; s/^(.*?)\t//; ,if ($1 eq $name) ?{ s{(s\\_[0-9a-f]+)} { ?exists($sym->{$1}) ? $sym->{$1} :? $default; }ge; printf $fh $format, $_; } } ?} } b?ootstrap B; 1; __END__ =head1 NAME B - The Perl Compi4ler ?=head1 SYNOPSIS use B; =head1 DESCRIPTION T?he C module ?supplies classes which allow a Perl program to d?elve into its ?own innards. It is the module used to implement t?he "backends"? of the Perl compiler. Usage of the compiler doeU;@Krs ?not require knowledg?e of this module: see the F module for t?he user-visible par?t. The C module is of use to those who wa?nt to write new co?mpiler backends. This documentation assumes t?hat the reader kn?ows a fair amount about perl's internals inclu?ding such things? as SVs, OPs and the internal symbol table and syntax t?ree of? a program. =head1 OVERVIEW OF CLASSES The C structures? used? by Perl's internals to hold SV and OP information (PVIV, AV, ?HV, ., OP, SVOP, UNOP, .?) are modelf8(led on a class hierarchy and the? C module gives a?ccess to them via a true object hierarchy.? Structure fields whi?ch point to other objects (whether types ?of SV or types of OP) ?are represented by the C module as Pe?rl objects of the appro?priate class. The bulk of the C modu?le is the methods for ac'cessing fields of these structures. No?t?e that all access is read-only: you cannot modify the interna?ls? by using this module. =head2 SV-RELATED CLASSES B::IV, B:?:NV?, B::RV, B::PV, B::PVIV, B_3]kS::PVNV, B::PVMG, B::BM, B::PVLV, B::A?V, ?B::HV, B::CV, B::GV, B::FM, B::IO. These classes correspond ?in? the obvious way to the underlying C structures of similar na?m?es. The inheritance hierarchy mimics the underlying C "inherit??ance". Access methods correspond to the underlying C macros for?? field access, usually with the leading "class indication" pre?fix removed (Sv, Av, Hv, .?). The leading prefix is only lef?t in cases where its removal w?ould cause a clash in method nam?e. For example, C sta?ys as-is since its abbreviation would c?lash with the "superclas?s" method C (corresponding to ?the C function C). =head2 B::SV METHODS =over 4 =?item REFCNT =item FLAGS ?=back =head2 B::IV METHODS =over 4? =item IV =item IVX =ite?m needs64bits =item packiv =back ? =head2 B::NV METHODS =over4 4 =item NV =item NVX =back =h?ead2 B::RV METHODS? =over 4 =item RV =back =head2 B::PV MET?HODS =over 4 =ite?m PV =back =head2 B::PVMG METHODS =over ?4 =item MAG?px>CIC =ite?m SvSTASH =back =head2 B::MAGIC METHODS  =over 4? =item MOREM?AGIC =item PRIVATE =item TYPE =item FLAGS =it?em OBJ =item ?PTR =back =head2 B::PVLV METHODS =over 4 =it?em TARGOFF =it?em TARGLEN =item TYPE =item TARG =back =hea?d2 B::BM METHODS? =over 4 =item USEFUL =item PREVIOUS =item? RARE =item TABL?E =back =head2 B::GV METHODS =over 4 =ite?m NAME =item STASH =item? SV =item IO =item FORM =item AV? =item HV =item EGV =item? CV =item CVGEN =item LINE =ite?m FQͭ"(S zILEGV =item GvREFCNT =it?em FLAGS =back =head2 B::IO METHODS =o?ver 4 =item LINES =i?tem PAGE =item PAGE_LEN =item LINES_LE?FT =item TOP_NAME =it?em TOP_GV =item FMT_NAME =item FMT_GV? =item BOTTOM_NAME =it?em BOTTOM_GV =item SUBPROCESS =item ?IoTYPE =item IoFLAGS =b?ack =head2 B::AV METHODS =over 4 =?item FILL =item MAX =ite?m OFF =item ARRAY =item AvFLAGS =?back =head2 B::CV METHODS  =over 4? =item STASH =item START? =item ROOT =item GV =item FILEGV ? =item DEPTH =item L1Ɓ}݋PADLI?ST =item OUTSIDE =item XSUB =item X?SUBANY =back =head2 B::HV METH?ODS =over 4 =item FILL =item? MAX =item KEYS =item RITER ?=item NAME =item PMROOT =item ?ARRAY =back =head2 OP-RELATE?D CLASSES B::OP, B::UNOP, B::BIN?OP, B::LOGOP, B::CONDOP, B::L?ISTOP, B::PMOP, B::SVOP, B::GVOP, ?B::PVOP, B::CVOP, B::LOOP, B?::COP. These classes correspond in ?the obvious way to the unde?rlying C structures of similar names. The in?heritance hierarc?hy mimics the underlying C "inheritance". Acce?ssfʧW E methods corre?spond to the underlying C structre field names,? with the leading "clas?s indication" prefix removed (op_). =he?ad2 B::OP METHODS =ov?er 4 =item next =item sibling =item pp?addr This returns th?e function name as a string (e.g. pp_add, ?pp_rv2av). =item de?sc This returns the op description from th?e global C op_desc ?array (e.g. "addition" "array deref"). =ite?m targ =item type? =item seq =item flags =item private =back =head?2 B::UNO?P METHOD =over 4 =item first =back =DZu The C m?od?ule exports a variety of functions: some are simple utility f?u?nctions, others provide a Perl program with a way to get an in??itial "handle" on an internal object. =over 4 =item main_cv ?Return t?he (faked) CD>5c䈶V corresponding to the main part of the P?erl progra?m. =item main_root Returns the root op (i.e. an object in ?the? appropriate B::OP-derived class) of the main part of the P?erl ?program. =item main_start Returns the starting op of the? main? part of the Perl program. =item comppadlist Returns th?e AV o?bject (i.e. in class B::AV) of the global comppadlist. ?=item s?v_undef Returns the SV object corresponding to the C v?ariable ?C. =item sv_yes Returns the SV object corr?esponding toɑlP the ?C variable C. =item sv_no Returns ?the SV object corre?sponding to the C variable C. =item walkopt?ree(OP, METH?OD) Does a tree-walk of the syntax tree based at ?OP and calls ?METHOD on each op it visits. Each node is visited? before its ch?ildren. If C (q.v.) has been c?alled to turn d?ebugging on then the method C? is called on ea?ch op before METHOD is called. =item walkoptr?ee_debug(DEBUG) ?Returns the current debugging flag for C. If the optional D?EBUG argument is non-zero, it sets ?the debugging flag to that. ?See the description of C above? for what the debuggi?ng flag does. =item walksymtable(SYMREF,? METHOD, RECURSE) Wal?k the symbol table starting at SYMREF an?d call METHOD on each s?ymbol visited. When the walk reached pa?ckage symbols "Foo::" it? invokes RECURSE and only recurses int?o the package if that sub? returns true. =item svref_2object(S?V) Takes any Perl variabl?e and turns it into an object ino|#@l the? appropriate B::OP-derived or B::SV?-derived class. Apart from? functions such as C, this? is the primary way to get an ini?tial "handle" on a internal pe?rl data structure which can then? be followed with the other acc?ess methods. =item ppname(OPNU?M) Return the PP function name ?(e.g. "pp_add") of op number O?PNUM. =item hash(STR) Returns a string in the form "0x.?" r?epresenting the value of the internal hash function used by ?pe?rl on string STR. =item cast_I32(I) Casts I to tn9,he internal ?I32 type used by that perl. =item minus_c ? Does the equivale?nt of the C<-c> command-line option. Obviousl?y, this is only useful in? a BEGIN block or else the flag is set too late. ?=item cstri?ng(STR) Returns a double-quote-surrounded escaped v?ersion of ?STR which can be used as a string in C source code. ?=item cla?ss(OBJ) Returns the class of an object without the pa?rt of th?e classname preceding the first "::". This is used to t?urn "B:?:UNOP" into "UNOP" for example. =item th{@xQbhreadsv_names I:n a pe?rl compiled for threads, this returns a list of the ?special pe?r-thread threadsv variables. =item byteload_fh(FILEH?ANDLE) Load the ?contents of FILEHANDLE as bytecode. See docume?ntation for the ?B module in F for how to ?generate byteco?de. =back =head1 AUTHOR Malcolm Beattie, C =cut }~ 55a@@ك <.( uB38.56nЗ@@쭠??? 쭠}~ ?~ʹ p$_? 쭠~ʹ * ak8dJ =P  ?쭠5E5E <~ʹ *T??package Benchmark; =?head1 NAME Benchmark - benchmark running ?times of code timet?his - run a chunk of code se/-]młV_0veral times ti?methese - run several chunk?s of code several times timeit - ru=n a chunk of code and see ?how long it goes =head1 SYNOPSIS timethis ($count, "code")?; # Use Perl code in strings. !timethese($count, { 'Na?me1' => '.code1.', 'Name2' => '.code2.', }); # ?. or use subroutine references. &timethese($count, { 'Name?1' => sub { .code1. }, 'Name2' => sub { .code2. }, ?}); $t = timeit($count, '. other code.') ?print "$cou?nt loops of other c2 8voode took:",timestr($t),"\n"; =he?ad1 DESCRIPTION T?he Benchmark module encapsulates a number of ?routines to help ?you figure out how long it takes to execute so?me code. =head2? Methods =over 10 =item new Returns the curr ent time. Exa?mple: use Benchmark; $t0 = new Benchmark; # . your ?code here . $t1 = new Benchmark; $td = timediff($t1, $t?0); print "the code took:",times?tr($td),"\n"; =item debug ? Enables or disable debugging by set%ting the C<$Benchmark::Deb?ug> flag: 9asHB debug Benchmark 1; #$t = timeit(10, ' 5 ** $Global '); ? ?debug Benchmark 0; =back =head2 Standard Exports The foll?owi?ng routines will be exported into your namespace if you use? the? Benchmark module: =over 10 =item timeit(COUNT, CODE) A?rgume?nts: COUNT is the number of times to run the loop, and CO?DE is ?the code to run. CODE may be either a code reference or? a string to be eval'd; either way it ?will be run in the call?er's package. Returns: a Benchmark obje?ct. =item timethis ( ?CӢl3t+ OUNT, CODE, [ TITLE, [ STYLE ]] ) Time ?COUNT iterations of CODE. COD?E may be a string to eval or a cod?e reference; either way the ?CODE will run in the caller's packa?ge. Results will be printed? to STDOUT as TITLE followed by the ?times. TITLE defaults to "?timethis COUNT" if none is provided. ?STYLE determines the form?at of the output, as described for tim?estr() below. The COUNT? can be zero or negative: this means the I to run. A zero signifies the defaul?t of 3J:Ӻ3 second?s. For example to run at least for 10 seconds: ?timethis(-10, $code)? or to run two pieces of code tests for at- least 3 seconds: ? timethese(0, { test1 => '. ', test2 => '.?'}) CPU seconds i?s, in UNIX terms, the user time plus the syst?em time of the pr?ocess itself, as opposed to the real (wallcloc?k) time and the ?time spent by the child processes. Less than 0?.1 seconds is n?ot accepted (-0.01 as the count, for example, will caus?e a fa?tal runtime exception). Note that the CPU secoե9EInds is the? B time: CPU scheduling and other operating system fac?tors may com?plicate the attempt so that a little bit more time ?is spent. ?The benchmark output will, however, also tell the nu?mber of C runs/second, which should be a more interestin?g number ?than the actually spent seconds. Returns a Benchmark ?object. ? =item timethese ( COUNT, CODEHASHREF, [ STYLE ] ) The? CODEHA?SHREF is a reference to a hash containing names as keys and ei?th?er a string to eval or a code referֿzfOJence for each value. For ?eac?h (KEY, VALUE) pair in the CODEHASHREF, this routine will call ? t?imethis(COUNT, VALUE, KEY, STYLE) The routines are called i?n ?string comparison order of KEY. The COUNT can be zero or neg?a?tive, see timethis(). =item timediff ( T1, T2 ) Returns the ??difference between two Benchmark times as a Benchmark object su??itable for passing to timestr(). =item timestr ( TIMEDIFF, [ ?S?TYLE, [ FORMAT ] ] ) Returns a string that formats the times? in the TI?MEDIFF object in (;"Lthe requested STYLE. TIMEDIFF is e?xpected to b?e a Benchmark object similar to that returned by timediff(?). S?TYLE can be any of 'all', 'noc', 'nop' or 'auto'. 'all' s?hows e?ach of the 5 times available ('wallclock' time, user tim?e, syst?em time, user time of children, and system time of chil?dren). '?noc' shows all except the two children times. 'nop' sh?ows only ?wallclock and the two children times. 'auto' (the def?ault) will? act as 'all' unless the children times are both zer?o, in which case itE-Kؒ)c2=? acts as 'noc'. FORMAT is the L-style format specif?ier (without the leading '%') to use to print the? times. It def?aults to '5.2f'. =back =head2 Optional Exports? The following? routines will be exported into your namespace ?if you specifica?lly ask that they be imported: =over 10 =ite?m clearcache ( CO?UNT ) Clear the cached time for COUNT rounds? of the null loop.? =item clearallcache ( ) Clear all cached ?times. =item disab?lecache ( ) Disable caching of timings for? the null lKk~oop. This will fo?rce Benchmark to recalculate thes?e timings for each new piece o?f code timed. =item enablecache ( ) En?able caching of timings? for the null loop. The time taken for ?COUNT rounds of the null? loop will be calculated only once for? each different COUNT use?d. =back =head1 NOTES The data is ?stored as a list of values% from the time and times functions: ? ?($real, $user, $system, $children_user, $children_system) ?in s?econds for the whole loop (not divided by the number of ro?unU"%Eb8ds). The timing is done using ?time(3) and times(3). Code ?is executed in the caller's package?. The time of the null loop (a loo?p with the same number of ro?unds but empty loop body) is subtr?acted from the time of the re?al loop. The null loop times are? cached, the key being the num?ber of rounds. The caching can b?e controlled using calls like these: clearcache($key); ?clearallcache(); disablecache(); ?enablecache(); =head1 ?INHERITANCE Benchmark inherits from no ;other class, excהL"3mept of? course for Exporter. =head1 CAVEATS? Comparing eval'd string?s with code references will give you i?naccurate results: a code refere?nce will show a slower executio?n time than the equivalent eval?'d string. The real time timing? is done using time(2) and the? granularity is therefore only on?e second. Short tests may pr?oduce negative figures because per?l can appear to take longer ?to execute the empty loop than a short test; try: ?timethis?(100,'1'); The system time of the null loop migqyC7ht be s3lightly? more than the system time of the loop with ?the actual code an?d therefore the difference might end up being? E 0. =head1 AUTHORS? Jarkko Hietaniemi >, T?im Bunce > =head1 MODIFICATION HISTORY ?September 8th, 1994; by? Tim Bunce. March 28th, 1997; by Hugo v?an der Sanden: added s?upport for code references and the alread?y documented 'debug' ?method; revamped documentation. April 04-?07th, 1997: by Jarkk?o Hietaniemi, added the run-for-some-tijo.00me f?unctionality. =cut? # evaluate something in a clean lexical environmen?t sub _do?eval { eval shift } # # put any lexicals at file scop?e AFTER here # ?use Carp; use Exporter; @ISA=(Exporter); @EXPOR?T=qw(timeit tim?ethis timethese timediff timestr); @EXPORT_OK=qw?(clearcache cl?earallcache disablecache enablecache); &init; s ub init { ?$debug = 0; $min_count = 4; $min_cpu = 0.4; $default?fmt = '5.2f'; $defaultstyle = 'auto'; ?# The cache can cau?se a slight loss of sys time aތ*N610) with *very* large counts (>10) ;# or works on ?a very slow machine the cache may be useful. &disablecache;  ?&clea?rallcache; } sub debug { $debug = ($_[1] != 0); } sub clearc?ache ?{ delete $cache{$_[0]}; } sub clearallcache { %cache = (?); } su b enablecache 5{ $cache = 1; } sub disablecache { $ca?che = 0; } # -? Functions to process the 'time' data type su?b new { my @t = (?time, times, @_ == 2 ? $_[1] : 0); print "?new=@t\n" if $debu?g;ߍy>jr|a bless \@t; } sub cpu_p { my($r,$pu,$p?s,$cu,$cs) = @{$_[0 ]}; $pu+$ps ; } sub cpu'_c { my($r,$pu,$p?s,$cu,$cs) = @{$_[0]}; ?$cu+$cs ; } sub cpu_a { my($r,$pu,$ps,$cu,$cs)? = @{$_[0]}; $pu+?$ps+$cu+$cs ; } sub real { my($r,$pu,$ps,$cu?,$cs) = @{$_[0]}; $r ; } sub timediff { my($a, $b) = @_;? my @r; ?for (my $i=0; $i < @$a; ++$i) { push(@r, $a->[$i?] - $b->[$i]); } bless \@r; } sub timestr { my($tr, ?$style, $f) = @_; my @t = @$tr; )warn "bad time value (@t)?" unless @t=X=6; %my($r, $pu, $ps, $cu, $cs, $n) = @t; my($?pt, $ct, $t) = ($tr->cpu_p, $tr->cpu_c, $tr->cpu_a); $$f = $?defaultfmt unless defined $f; ?# format a time in the required style,? other formats may be added here $style ||= $defaultstyle; ? 6$style = ($ct>0) ? 'all' : 'noc' if $style eq 'auto'; 1my ?$s = "@t $style"; # default for unknown style ?$s=sprintf("%2?d wallclock secs (%$f usr %$f sys + %$f cusr %$f csys = %$f CP?U)", @t,$t) if $style eq 'all'; ?$s=sprintf("%2d wallclo?ck p:鏏%^rsecs (%$f usr + %$f sys = %$f CPU)", $r,$pu,$ps,$pt) if? $style eq 'noc'; ?$s=sprintf("%2d wallclock secs (%$f cusr ?+ %$f csys = %$f CPU)", $$r,$cu,$cs,$ct) if $style eq 'nop'; <$s? .= sprintf(" @ %$f/s (n=$n)", $n / ( $pu + $ps )) if $n; $s?; } sub timedebug { my($msg, $t) = @_; 5print STDERR "$ms?g",timestr($t),"\n" if $debug; } # -? Functions implementing ?low-level support for timing loops sub runloop { my($n, $c?) = @_; ?$n+=0; # force numeric now, so garbage won't caтs6reep ?into the eval 'croak "negative loopcount $n" if $n<0; con?fess "U>sage: runloop(number, [string | coderef])" unless defin?ed $c; 0my($t0, $t1, $td); # before, after, difference 6# find pac?kage of caller so we can execute code there my($curpack) = c?aller(0); my($i, $pack)= 0; =while (($pack) = caller(++$i)?) { last if $pack ne $curpack; } my ($subcode, $subref)?; ?if (ref $c eq 'CODE') { $subcode = "sub { for (1 .. $n) {? loca"l \$_; package $pack; &\$c; } }"; $subre2B-PSS~;kf = eval $sub?code; } +else { $subcode = "sub { for (1 .. $n) { l"ocal ?\$_; package $pack; $c;} }"; $subref = _doeval($subcode); ? } ?croak "runloop unable to compile '$c': $@\ncode: $subcode\n" if? $@; 3print STDERR "runloop $n '$subcode'\n" if $debug; $?t0 = Benchmark->new(0); &$subref; $t1 = Benchmark->new($n?); $td = &timediff($t1, $t0); timedebug("runloop:",$td);? $td; } sub timeit { my($n, $code) = @_; my($wn, $wc?, $wd); .printf STDERR "timeit $n $coՖkNSy@ de\n" if $debug; +if? ($cache && exists $cache{$n}) { $wn = $ cache{$n}; 5} else ?{ $wn = &runloop($n, ''); $cache{$n} = $wn; } $wc = &r?unloop($n, $code); $wd = timediff($wc, $wn); timedebug("timeit:? ",$wc); timedebug(" - ",$wn); timedebug(" = ",$wd); ? $wd; } my $default_for = 3; my $min_for = 0.1; sub run?for { my ($code, $tmax) = @_; ?if ( not defined $tmax or ?$tmax == 0 ) { $tmax = $default_for; )} elsif ( $tmax < 0 )? { $tmax = -$tmax; } dikFXFBKje "runfor(.), $tmax): timelimit? cannot be less than $#min_for.\n" if $tmax < $min_for; ?my? ($n, $td, $tc, $ntot, $rtot, $utot, $stot, $cutot, $cstot ); ? :# First find the minimum $n that gives a non-zero timing.   my? $nmin; ?for ($n = 1, $tc = 0; $tc <= 0; $n *= 2 ) { $td = ?timeit($n, $#code); $tc = $td->[1] + $td->[2]; } $nmin ?= $n; my $ttot = 0; 2my $tpra = 0.05 * $tmax; # Target/ti?me practice. :# Double $n until we have think we have practi?ced enough. >for ( $drފVn = 1; $ttot < $tpra; $n *= 2 ) { $td = ?timeit($n, $co?de); $tc = $td->cpu_p; $ntot += $n; $rtot += ?$td->[0]; $uto?t += $td->[1]; $stot += $td->[2]; $ttot = $ut?ot + $stot; $cu&tot += $td->[3]; $cstot += $td->[4]; } my $r; ? "# Then iterate towards the $tmax. ?while ( $ttot < $tmax ?) { $r = $tmax / $ttot - 1; # Linear app?roximation. $n = int?( $r * $n ); $n = $nmin if $n < $nmin; $?td = timeit($n, $cod?e); $ntot += $n; $rtot += $td->[0]; $uto?t += $td->[1]; $st?ot += $td->[2iIw ]; $ttot = $utot + $stot; $cu#tot += $td->[3]; ?$cstot += $td->[4]; } ?return bless [ $rtot, $utot, $sto?t, $cutot, $cstot, $ntot ]; }  # -? Functions implementing hi?gh-level time-then-print utilities sub n_to_for { my $n = shift; ? ?return $n == 0 ? $default_for : $n < 0 ? -$n : undef; } sub ?timethis{ $my($n, $code, $title, $style) = @_; my($t, $fo?r, $forn); ?if ( $n > 0 ) { croak "non-integer loopcount $n?, stopped" if i?nt($n)<$n; $t = timeit($n, $code); $title = "?time觝pBthis $n" unless defined $title; &} else { $fort = n_to?_for( $n ); $t ?= runfor($code, $fort); $title = "timethis f?or $fort" unless d#efined $title; $forn = $t->[-1]; } l?ocal $| = 1; #$style = "" unless defined $style; printf("%10s: ", ?$title); .print timestr($t, $style, $defaultfmt),"\n"; $n? = $forn if defined $forn; 3# A conservative warning to spot? very silly tests. 8# Don't assume that your benchmark is ok ?simply because # you don't get this warning! print "Rڴ?H 9(w?arning: too few iterations for a reliable count)\n" if  $n ?< $min_count || ($t->real < 1 && $n < 10) || $t->cpu_?a < $min_cpu; $t; } sub timethese{ my($n, $alt, $style) ?= @_; 1die "usage: timethese(count, { 'Name1'=>'code1', .! }\n" un?less ref $alt eq HASH; my @names = sort keys %$alt; #$styl?e = "" unless defined $style; print "Benchmark: "; ?if ( $?n > 0 ) { croak "non-integer loopcount $n, stopped" if i-nt($n?)<$n; print "timing $n iterations of"; } else Tus mA{ print "run?ning"; } print " ", join(', ',@names); ? unless ( $n >? 0 ) { my $for = n_to_for( $n ); print ", each! for at least ?$for CPU seconds"; } print ".\n"; ?# we could save t?he results in an array and produce a summary here # sum, min, max, ?avg etc etc foreach my $name (@names) { /timethis ($n, $al?t -> {$name}, $name, $style); } } 1; %}~0h55agDf35@@ك <.~2 9t 2S?? +1Rd@??9t}~??~ʹ$_ 9t~ʹ7 ak8dH? =P  9t2S?+1Rd@? ~ʹ??package CGShxW'R4UI; require 5.004; # See the bottom of thi?s file for ?the POD documentation. Search for the # string '=head'. #? You? can run this file through either pod2man or pod2html to p?roduc?e pretty # documentation in manual or html file format (t?hese u?tilities are part of the # Perl 5 distribution). # Copy?right 1?995-1998 Lincoln D. Stein. All rights reserved. # It m?ay be us?ed and modified freely, but I do request that this cop?yright # ?notice remain attached to the file. You may modify t?his module 3siGas you ? # wish, but if you redistribute a modified? version, please att?ach a note # listing the modifications you have ma?de. # The mo7st recent version and complete docs are available? at: # http://w$.genome.wi.mit.edu/ftp/pub/software/W/cgi_?docs.html # )ftp://ftp-genome.wi.mit.edu/pub/software/W&/ $C?GI::revision = '$Id: CGI.pm 1.1 19?/02/23 13:43:45 davidf Exp ?$'; $CGI::VERSION='2.42'; # HARD-CO?DED LOCATION FOR FILE UPLO?AD TEMPORARY FILES. # UNCOMMENT THIS 1ONLY IF YOU KNOW WHAT YOU?'REB.J'nzE+ DOING. # $TempFile::TMPDIRECTORY = '/usr/tmp'; # >5 Here? are some globals that you might want to adjust < sub initialize_glob?als { ?# Set this to 1 to enable copious autoloader debugging? messages $AUTOLOAD_DEBUG = 0; <# Change this to the pre?ferred DTD to print in start_html() ,# or use default_dtd('te?xt of DTD to use'); )$DEFAULT_DTD = '-//IETF//DTD HTML//EN'; ? &# Set this to 1 to enable NPH scripts # or: # 1) u?se CGI qw(-nph) # 2) $CGI::nph(1) # 3) print hea`YEs6der(-?nph=>1) $NPH = 0; .# Set this to 1 to disable debugging f?rom the # command line $NO_DEBUG = 0; 4# Set this to 1 to make? the temporary files created ,# during file uploads safe from? prying eyes # or do. # "1) use CGI qw(:private_tempfi?les) # 2) $CGI::private_tempfiles(1); $PRIVATE_TEMPFILE?S = 0; ># Set this to a positive value to limit the size of ?a POSTing # to a certain number of bytes: $POST_MAX = -1;? 2# Change this to 1 to disable uploads entire2fly:  $DISA?BLE_UPLOADS = 0; 0# Other globals that you shouldn't worry a?bout. undef $Q; $BEEN_THERE = 0; undef @QUERY_PARAM;  undef ?%EXPORT; !# prevent complaints by mod_perl 1; } # - ST?ART OF THE LIBRARY -? # make mod_perlhappy initialize_globals?(); # FIGURE OUT THE ?OS WE'RE RUNNING UNDER # Some systems su?pport the $^O variable.? If not # available then require() the? Config library unless ($OS) { 7unless ($OS = $^O) { requir?e Config; $OS = $Config::Config{'osnama e'}; } } if ($OS=~/W?in/i) { )$OS = 'WINDOWS'; } elsif ($OS=~/vms/i) { )$OS = 'V?MS'; } elsif ($OS=~/^MacOS$/i) { +$OS = 'MACINTOSH'; } elsif ($OS=~/o?s2/i) { $OS = 'OS2'; } else { ?$OS = 'UNIX'; } # Some OS ?logic. Binary mode enabled on DOS, ?NT and VMS $needs_binmode ?= $OS=~/^(WINDOWS|VMS|OS2)/; # This ?is the default class for ?the CGI object to use when all else fa?ils. $DefaultClass = 'CG?I' unless defined $CGI::DefaultClass; 1# This is where to look? for autoloaded routines. ?$AutîRXholoadClass = $DefaultClass unles?s defined $CGI::AutoloadCla?ss; # The path separator is a slas?h, backslash or semicolon, d$epending # on the paltform. $SL = { >UNI?X=>'/', OS2=>'\\', WINDOWS=>'\\', MACINTOSH=>':', VMS=>'/' ?}?->{$OS}; # This no longer seems to be necessary # Turn on NPH?? scripts by default when running under IIS server! # $NPH++ if ??defined($ENV{'SERVER_SOFTWARE'}) && $ENV{'SERVER_SOFTWARE'}=~/?I?IS/; $IIS++ if defined($ENV{'SERVER_SOFTWARE'}) && $ENV{'SERV?ER_SOFTWARE'}=~/IIS/;O(_,]{ # Turn ?on special checking for Doug Ma?cEachern's modperl if (defined($ENV{'GATEWAY_INTERFACE'}) && ? =($MOD_PERL = $ENV{'GATEWAY_INTERFACE'} =~ /^CGI-Perl\//)) { $| =? 1; ?require Apache; } # Turn on special checking for ActiveS?tate's ?PerlEx $PERLEX++ if defined($ENV{'GATEWAY_INTERFACE'}) ?&& $ENV{?'GATEWAY_INTERFACE'} =~ /^CGI-PerlEx/; # Define the C?RLF seque?nce. I can't use a simple "\r\n" because the meaning? # of "\n"? is different on different OS's (sometimes it genera?tes CRLF, so N. metimes LF # and somet?imes CR). The most popular? VMS web server # doesn't accept CRL?F -- instead it wants a LR?. EBCDIC machines don't # use ASCII,? so \015\012 means something diff?erent. I find this all # reabinmode(main::STDOUT); *?$CGI::DefaultClass->binmode(main::STDIN); 3$CGI::DefaultClass?->biQ li)nmode(main::STDERR); } %EXPO?RT_TAGS = ( ':html2'=>['h1'?..'h6',qw/p br hr ol ul li dl dt dd menu code var strong em ? >tt u i b blockquote pre img a address cite samp dfn html head 9b?ase body Link nextid title meta kbd start_html end_html ?in?put Select option comment/], ':html3'=>[qw/div table captio+n? th td TR Tr sup sub strike applet Param ?embed basefont s?tyle span layer ilayer font frameset frame scri?pt small big/],? ':netscape'=>[qw/blink fontsize center/], '0:form'=>[qU&9ΞZ~w/te?xtfield textarea filefield passwor(d_field hidden checkbox chec?kbox_group ? submit reset defaults radio_group popup_menu b?utton autoEscape ? scrolling_list image_button start_form end_form ?startform endform ? start_multipart_form isindex tmpFileNam?e uploadInfo URL_ENCOD?ED MULTIPART/], ':cgi'=>[qw/param path?_info path_translated u$rl self_url script_name cookie dump ?? raw_cookie request_method query_string accept user_agent remot?e_host ? remote_addr referer server_name serveltw &r_software se?rver_port server_protocol virtual_ho5st remote_ident auth_?type http use_named_parameters 0 save_parameters restore_par?ameters param_fetch ? remote_user user_name header redirect import_na?mes put Delete ?Delete_all url_param/], ':ssl' => [qw/https/]?, ':cgi-lib' =?> [qw/ReadParse PrintHeader HtmlTop HtmlBot Sp?litParam/], ':h?tml' => [qw/:html2 :html3 :netscape/], ':st?andard' => [qw/:ht?ml2 :html3 :form :cgi/], ':push' => [qw/mu?ltipart_init multip?art_start multipart_eJr<)tSqnd/], ':all' => [qw/?:html2 :html3 :netscape :form :cgi :internal/] 3 ); # to imp?ort symbols into caller sub import { 6my $self = shift; # Th?is causes modules to clash. # undef %EXPORT_OK; # undef %EXPORT; ? $self->_setup_symbols(@_); my ($callpack, $callfile, $ca?line) = caller; 3# To allow overriding, search through the? packages ?# Till we find one in which the correct subroutine? is defined. *my @packages = ($self,@{"$self\:\:ISA"}); ?fo?reach $sym (keys %EXPORT) { my rS;3$pck; my $def = ${"$self\:\:*A?utoloadClass"} || $DefaultClass; foreach $pck (@packages) { ? :if (defined(&{"$pck\:\:$sym"})) { $def = $pck; last; ?3} } *{"${callpack}::$sym"} = \&{"$def\:\:$sym"}; } } sub compile? { my $pack = shift; ;$pack->_setup_symbols('-compile',@_)?; } sub expand_tags { my($tag) = @_; my(@r); )return (?$tag) unless $EXPORT_TAGS{$tag}; >foreach (@{$EXPORT_TAGS{$ta?g}}) { push(@r,&expand_tags($_)); } return @r; } #? Me?thod: new # The new rou?DҽS$tine. This will check the current en!vi?ronment # for an existing query' string, and initialize itself,? if so. # sub new { my($class,$initializer) = @_; my $s?elf = {}; 3bless $self,ref $class || $class || $DefaultClass; ?if (?$MOD_PERL) { Apache->request->register_cleanup(\&CGI::_reset_?globals); undef $NPH; } "$self->_reset_globals if $PERLEX?; $self->init($initializer); ?return $self; } # We provid?e a DESTROY method so that the autoall_parameters u?nless79݀:z @p; my($name,$value,@other); .# For compatibility b?etween old calling style #and use_named_parameters() style, ?:# we have to special case for a single parameter present. ?i?f (@p > 1) { ($name,$value,@other) = $self->rearrange([NAME,[?DEFAULT,?VALUE,VALUES]],@p); my(@values); if (substr($p[0],0,-1) eq '?-' || $self->use_named_parameters) { ?@values = defined($val?ue) ? (ref($value) && ref($value) eq 'ARR+AY' ? @{$value} : $va?lue) : (); } else { >foreach ($value,@other) { push(@vek** 2 Calu?es,$_) if defined($_); <} } # If values is provided, then ?we set it. if (@values) { $self->add_parameter($name); ? $self->{$name}=[@values]; } } else { $name = $p[0]; }? 3return () unless defined($name) && $self->{$name}; ?return wanta?rray ? @{$self->{$name}} : $self->{$name}->[0]; } sub self_or?_default { ?return @_ if defined($_[0]) && (!ref($_[0])) &&($?_[0] eq 'CGI'); unless (defined($_[0]) && ?(ref($_[0]) ?eq 'CGI' || UNIVERSAL::isa($_[0],'CGI')) # slightly3so optimized ?for common case =) { $Q = $CGI::DefaultClass->new unless de?fined($Q); unshif t(@_,$Q); } return @_; } sub self_or_?CGI { local $^W=0; # prevent a warning ?if (defined($_[0?]) && (substr(ref($_[0]),0,3) eq 'CGI' || UNIVERSAL::isa($_[0],'CG?I') { return @_; %} else { return ($DefaultClass,@_); ?} } #? # THESE METHODS ARE MORE OR LESS PRIVATE # GO TO THE _?_DATA__ %SECTION TO SEE MORE # PUBLIC METHODS #? # Initialize? the query object from the environment. # YA:sIf a paramet?er list? is found, this object will be set # to an associative a?rray i?n which parameter names are keys # and the values are sto?red a?s lists # If a keyword list is found, this method creates ?a bo?gus # parameter list with the single parameter 'keywords'. sub init {? my($self,$initializer) = @_; ?my($query_string,$meth,$con?tent_length,$fh,@lines) = ('','','',''); 9# if we get calle?d more than once, we want to initialize 7# ourselves from the? original query (which may be gonG[qoƛe # if it was read from ST?DIN originally.) ?if (defined(@QUERY_PARAM) && !defined($init?ializer)) { foreach (@QUERY_PARAM) { ?$self->param('-name'?=>$_,'-value'=>$QUERY_PARAM{$_}); } return; } ?$meth=$?ENV{'REQUEST_METHOD'} if defined($ENV{'REQUEST_METHOD'}); ?$content_?length = defined($ENV{'CONTENT_LENGTH'}) ? $ENV{'CONTENT_LENGT?H'} : 0; ?die "Client attempted to POST $content_length bytes?, but POSTs ?are limited to $POST_MAX" if ($POST_MAX > 0) && (?$content_length > $POSTAf[a_MAX); $fh = to_filehandle($i+nitial?izer) if $initializer; METHOD: { =# Process multipart pos?tings, but only if the initializer is # not defined. ?if (?$meth eq 'POST' && defined($ENV{'CONTENT_TYPE'}) && $?ENV?{'CONTENT_TYPE'}=~m|^multipart/form-data| && !defined($in?itializer)? ) { my($boundary) = $ENV{'CONTENT_TYPE'} =~ /b?oundary=\?"?([^\";]+)\"?/; $self->read_multipart($boundary,$c ontent_l?ength); last METHOD; } 2# If initializer is defined, ?then read paramChmeeters # from it. if? (defined($initializer?)) { if (UNIVERSAL::isa($initializer,' CGI')) { -$query_s?tring = $initializer->query_string; ?last METHOD; } if? (ref($initializer) && ref($initializer) eq 'HASH') { ?fore?ach (keys %$initializer) { $self->param('-name'=>$_,'-value'=>$ini?tializer->{$_}); } =last METHOD; } if (defined?($fh) && ($fh ne '')) { ?while (<$fh>) { chomp; last? if /^=/; push(@lines,$_); } %# massage back into s?tandar'pAjZxd format = if ("@lines" =~ /=/) { $query_string=jo?in("&",@lines); .} else { $query_string=join("+",@lines)?; } ?last METHOD; } # last chance -- treat it as ?a string ?$initializer = $$initializer if ref($initializer) ?eq 'SCALAR'; 2 $query_string = $initializer; last METHOD; } ? 1# If method is GET or HEAD, fetch the query from # the env?ironment. ?if ($meth=~/^(GET|HEAD)$/) { $query_string = $E?NV{'QUERY_STR2ING'} if defined $ENV{'QUERY_STRING'}; last ox\@riME?THOD; } ?if ($meth eq 'POST') { $self->read_from_clie?nt(\*STDIN,\$query_string,$content_length,0) ?if $content_l?ength > 0; # Some people want to have their cak?e and eat it? too! # Uncomment this line to have the contents? of the que?ry string # APPENDED to the POST data. # $quer?y_string .= (lengt?h($query_string) ? '&' : '') . $ENV{'QUERY_ST8RING'} if defined? $ENV{'QUERY_STRING'}; last METHOD; } ?# If $meth is n?ot of GET, POST or HEAD, assume we're being debugge5 d offline.? ?# Check the command line and then the standard input for da?ta. ?# We use the shellwords package in order to behave the w?ay that # UN*X programmers expect. ;$query_string = read_?from_cmdline() unless $NO_DEBUG; } 8# We now have the quer?y string in hand. We do slightly :# different things for keyword lis?ts and parameter lists. 9if ($query_string ne '') { if ($que?ry_string =~ /=/) { /$self->parse_params($query_string); } ?else { $self->add_parameter('keywords'jSn#k); ?$self->{'keyw?ords'} = [$self->parse_keywordlist($query_string)]; } } ? <# Special case. Erase everything if there is a field named ? # .defaults. 2if ($self->param('.defaults')) { undef %{$se?lf}; } 6# Associative array containing our defined fieldn?ames $self->{'.fieldnames'} = {}; ?foreach ($self->param('.cgifiel?ds')) { $self->{'.fieldnames'}- >{$_}++; }  :# Clear o?ut our default submission button flag if present $self->dele?te('.submit'); $self->delete('save_?request unless $initializer; } # FUNCTIONS TO OVERprint(@p); } # print to standard output (for ?overriding in mod_perl) sub print { shift; ?CORE::print(@?_); } # unescape URL-encoded data sub unescape { shift() if? ref($_[0]); my $todecode = shift; (return undef unless defined($t?odecode); $todecode =~ tr/+/ /; # pluses become spaces 7?$todecode =~ s/%([0-9a-fA-F]{2})/pack("c",hex($1))/ge; retur?n $todecode;# }  !0g # URL-encode data sub escape { 1shift() if r?ef($_[0]) || $_[0] eq $DefaultClass; my $toencode = shift; ? (return undef unless defined($toencode); +$toencode=~s/([^a-?zA-Z0-9_.-])/uc sprintf("%02x",ord($1))/eg; (return $toenco?de; } sub save_request { my($self) = @_; ?# We're going t?o play with the package globals now so that if w e get called  ?# agai?n, we initialize ourselves in exactly the same way. This allo?ws '# us to have several of these objects. @QUERY_PARAM = ?$self#- za>param; # save list of parameters 8foreach (@QUERY_PAR?AM) { $QUERY_PARAM{$_}=$self->{$_}; } } sub parse_params {? my($self,$tosplit) = @_; "my(@pairs) = split('&',$tosplit?); my($param,$value); ?foreach (@pairs) { ($param,$value)? = split('=',$_,2); $param ?= unescape($param); $value = unes?cape($value); $self->add_par3ameter($param); push (@{$self->{$param}}?,$value); } } sub add_parameter { my($self,$param)=@_; ? {'.parameters'}},$param) unless defined($se 264A4n'?lf->{$param}); } sub all_parameters { my $self = shift; ;?return () unless defined($self) && $self->{'.parameters'}; ,r?eturn () unless @{$self->{'.parameters'}}; ?return @{$self->{?'.parameters'}}; } # put a filehandle into binary mode (DOS) ?sub binmode { .CORE::binmode($_[1]); } sub _make_tag_func { ? my $tagname = shift; return qq{ sub $tagname { .# handle var?ious cases in which we're called 4# most of this bizarre stu?ff is to avoid -w errors shift if \$_[0] && (! ly$Ir2ef(\$_[0?]) && \$_[0] eq \$CGI::DefaultClass) || (ref(\$_[0]) && ? '(substr(ref(\$_[0]),0,3) eq 'CGI' || UNIVERSAL::isa(\$_?[0],'CGI');  my(\$attr) = ''; ?if (ref(\$_[0]) && ?ref(\$_[0]) eq 'HASH') { my(\@attr) = make<_attributes( '',sh?ift() ); \$attr = " \@attr" if \@attr; } ?my(\$tag,\$u?ntag) = ("\U<$tagname\E\$attr>","\U\E"); return \$tag u?nless \@_; ?my \@result = map { "\$tag\$_\$untag" } (ref(\$_?[0]) eq 'ARRAY') ? \@{\$_[0]} : "\@_";  {S]!#return "\@result";? } } } sub AUTOLOAD { ?print STDERR "CGI::AUTOLOAD for $A?UTOLOAD\n" if $CGI::AUTOLOAD_DEBUG; my $func = &_compile; ? ?goto &$func; } # PRIVATE SUBROUTINE # Smart rearrangement of? p?arameters to allow named parameter # calling. We do the rea?ran?gement if: # 1. The first parameter begins with a - # 2. Th?e us9e_named_parameters() method returns true sub rearrange {  my($se?lf,$order,@param) = @_; return () unless @param; .if (ref?($param[0]) eq 'HASH') { @param = )d ]%{$p aram[0]}; } else { ?return @param ?unless (defined($param[0]) && substr($param[?0],0,1) eq '-') || $self->use_named_parameters; } )# m?ap parameters into positional indices my ($i,%pos); $i = ?0; ?foreach (@$order) { foreach (ref($_) eq 'ARRAY' ? @$_ : ?$_) { $pos{$_} = $i; } $i++; } my (@result,%leftover);? "$#result = $#$order; # preextend ?while (@param) { my $key = uc?(shift(@param)); $key =~ s/^\-//; if (exists $pos{$key}) { ? $result[$pos{$key}] = sZX+whift(@param); } else { $$leftove?r{$key} = shift(@param); } } ?push (@result,$self->make_?attributes(\%leftover)) if %leftover; @result; } sub _comp?ile { my($func) = $AUTOLOAD; my($pack,$func_name); ?{ ?local($1,$2); # this fixes an obscure variable suicide probl?em?. $func=~/(.+)::([^:]+)$/; ($pack,$func_name) = ($1,$2); $?p?ack=~s/::SUPER$//; # fix another obscure problem $pack = ${"$/pack\:\:?AutoloadClass"} || $CGI::DefaultClass 1unless defined(${"$pa?ck\:\:AUTOLOADED_W\ ROUTINES"}); my($sub) = \%{"$pack\:\:SUBS?"}; unless (%$sub) { 1my($auto) = \${"$pack\:\:AUTOLOADED?_ROUTINES"}; eval "package $pack; $$auto"; die $@ if $@?; =$$auto = ''; # Free the unneeded storage (but don't undef? it!) } !my($code) = $sub->{$func_name}; ?$code = "su?b $AUTOLOAD { }" if (!$code and $func_name eq 'DESTROY'); i?f (!$code) { if ($EXPORT{':any'} || $EXPORT{'-any'} || $EX?PORT{$func_name} || (%EXPORT_OK || grep(++#$EXPORT_OK{$_},?&expand_FQEtags(':html') && $EXPORT_OK{$func_name}) { %$c?ode = _make_tag_func($func_name); } } 5die "Undefined ?subroutine $AUTOLOAD\n" unless $code; eval "package $pack; $?code"; if ($@) { $@ =~ s/ at .*\n//; die $@; } ?}  +delete($sub->{$func_name}); #free storage ?return "?$pack\:\:$func_name"; } sub _reset_globals { initializ%e_globa?ls(); } sub _setup_symbols { my $self = shift; my $compile = 0; ? fore?ach (@_) { $NPH++, next if /^[:-]nph$/; $NO_DEBUG++, z ym+?next if ?/^[:-]no_?[Dd]ebug$/; $PRIVATE_TEMPFILES++, next if /?^[:-]priv?ate_tempfiles$/; $EXPORT{$_}++, next if /^[:-]any$/;? $compile?++, next if /^[:-]compile$/; # This is probably e?xtremely ev?il code -- to be deleted # some day. if (/^[-]aut?oload$/) { my($pkg) = caller(1); ?*{"${pkg}::AUTOLOAD"} ?= sub { my($routine) = $AUTOLOAD; $r(outine =~ s/^.*::/CGI?::/; &$routine; }; )next; } foreach (&expand_tags($_)) { ? tr/a-z2A-Z0-9_//cd; # don't allow weird function na?'W~ $mes $?EXPORT{$_}++; } } +_compile_all(keys %EXPORT) if $compile?; } ## #* THESE FUNCTIONS ARE AUTOLOADED ON DEMAND # #?# $AUTOLOADED_ROUTINES = ''; ?# get rid of -w warning $AUTOLO?ADED_ROUTINES=<<'END_OF_AUTOLOAD4'; %SUBS = ( 'URL_ENCODED'=>? <<'END_OF_FUNC', sub URL_ENCODED { 'application/x-w?-form-ur?lencoded'; } END_OF_FUNC 'MULTIPART' => <<'END_OF_FUNC?', sub ?MULTIPART { 'multipart/form-data'; } END_OF_FUNC 'SERV?ER_PUSH' => < <<'END_OF_FUNC', #? Method: use_named_parameters # Forc?e CGI.pm to use named param?eter-style method calls # rather th?an positional parameters. T>he same effect # will happen autom?atically if the first parame2ter # begins with a -. sub use_nam?ed_parameters { ,my($self,$use_named) = self_or_default(@_); ? 7return $self->{'.named'} unless defined ($use_named); '# stupidit?y to avoid annoying warnings ?retu(,ʕ_1Mrn $self->{'.named'}=$use_n?amed; } END_OF_FUNC 'new_Multip?artBuffer' => <<'END_OF_FUNC',? # Create a new multipart buffer sub new_MultipartBuffer { .?my($self,$boundary,$length,$filehandle) = @_; ?return Multipa?rtBuffer->new($self,$boundary,$length,$filehandle'); } END_OF_F?UNC 'read_from_client' =>? <<'END_OF_FUNC', # Read data from a? file handle sub read_from_ client { +my($self, $fh, $buff, $?len, $offset) = @_; local $^W=0; # prevent a warning "return und?ef unless defined($fh); ?FعS uHyreturn read($fh, $$buff, $len, $offs?et); } END_OF_FUNC 'delete' => <<'END_OF_FUNC', #8 Method: d?elete # Deletes the named parameter entirely. # sub delete { ? 'my($self,$name) = self_or_default(@_); delete $self->{$na?me}; (delete $self->{'.fieldnames'}->{$name}; @{$self->{'.?parame*ters'}}=grep($_ ne $name,$self->param()); .return want?array ? () : undef; } END_OF_FUNC #? Method: import_names # I?mport all parameters into the given na2mespace. # Assumes namespace 'Q'? if not specified c7\R>rM#7 'import_names' => <<'END_OF_FUNC', sub im?port_names { 4my($self,$namespace,$delete) = self_or_default(?@_); -$namespace = 'Q' unless defined($namespace); ?die "Ca?n't import names into \"main\"\n" if \%{"${namespace}::" } == \?%::; 9if ($delete || $MOD_PERL) { # can anyone find an easie?r 7way to do this? foreach (keys %{"${namespace}::"}) { 'lo?cal *symbol = "${namespace}::${_}"; undef $symbol; unde?f @symbol; undef %symbol; } } my($param,@value,$var); ?for?each $par0iێmV{am ($self->param) { # protect against silly names ? (?$var = $param)=~tr/a-zA-Z0-9_/_/c; $var =~ s/^(?=\d)/_/; lo?c?al *symbol = "${namespace}::$var"; @value = $self->param($par.?am); @symbol = @value; $symbol = $value[0]; } } END_OF_FUN?C #6 Method: keywords # Keywords acts a bit differently. ?Ca?lling it in a list context # returns the list of keywords. ?#? Calling it in a scalar context gives you the size of the list?. #/ 'keywords' => <<'END_OF_FUNC', sub keywords { )my($self,@values?5ҿ^ln-) = self_or_default(@_); )# If values is provided, then we se?t it. 3$self->{'keywords'}=[@values] if defined(@values); ??my(@result) = defined($self->{'keywords'}) ? @{$self->{'keyword? s'}} : (); ?@result; } END_OF_FUNC # These are some tie() i?nterfaces for c+ompatibility # with Steve Brenner's cgi-lib=.pl? routines 'ReadParse' => <<'END_OF_FUNC', sub ReadParse { lo?cal(*in); if (@_) { *in = $_[0]; 4} else { my $pkg = cal?ler(); *in=*{"${pkg}::in"}; } tie(%in,CGI); ?return scg΋\>'alar(key?s %in); } END_OF_FUNC 'PrintHeader' => <<'END_OF_FUNC', sub P?rintHeader { !my($self) = self_or_default(@_); ?return $sel?f->header(); } END_OF_FUNC 'HtmlTop' => <<'END_OF_FUNC', sub ?HtmlTop { $my($self,@p) = self_or_default(@_); ?return $sel?f->start_html(@p); } END_OF_FUNC 'HtmlBot' => <<'END_OF_FUNC'?, sub HtmlBot { $my($self,@p) = self_or_default(@_); ?retur?n $self->end_html(@p); } END_OF_FUNC 'SplitParam' => <<'END_O?F_FUNC', sub SplitParam { my ($param) = @_; %my (@z[LCb.params) = split ?("\0", $param); ?return (wantarray ? @params : $params[0]); }? END_OF_FUNC 'Meth'Get' => <<'END_OF_FUNC', sub MethGet { ?r?eturn request_method() eq 'GET'; } END_OF_FUNC 'MethPost' => ?<<'END_OF_FUNC', sub MethPost { ?return request_method() eq '?POST'; } END_OF_FUNC 'TIEHASH' => <<'END_OF_FUNC', sub TIEHA?SH { ?return $Q || new CGI; } END_OF_FUNC 'STORE' => <<'END?_OF_FUNC', sub STORE { ?$_[0]->param($_[1],split("\0",$_[2])?); } END_OF_FUNC 'FETCH' => <<'END_OF_FUNC',N:`{]$t sub FETCH { return $_?[0] if $_[1] eq 'CGI'; 1return undef unless defined $_[0]->pa?ram($_[1]); ?return join("\0",$_[0]->param($_[1])); } END_OF_?FUNC 'FIRSTKEY%' => <<'END_OF_FUNC', sub FIRSTKEY { $_[0]->?{'.iterator'}=0; ?$_[0]->{'.parameters'}->[$_[0]->{'.iterator?'}++]; } END_OF_FUNC 'NEXTKEY' => <<'END_OF_FUNC', sub NEXTK?EY { ?$_[0]->{'.parameters'}->[$_[0]->{'.iterator'}++]; } END?_OF_FUNC, 'EXISTS' => <<'END_OF_FUNC', sub EXISTS { ?exists ?$_[0]->{$_[1]}; } END_OF_FUNC 'DELET~P.v$V'tE' => <<'END_OF_FUNC', sub DELETE? { ?$_[0]->delete($_[1]); } END_OF_FUNC 'CLEAR' => <<'END_OF?_FUNC', sub CLEAR { %{$_[0]}=(); } # END_OF_FUNC #+ # A?ppend a new value to an existing query ## 'append' => <<'EOF',? sub append { my($self,@p) = @_; ?my($name,$value) = $self?->rearrange([NAME,[VALUE,VALUES]],@p); ?my(@values) = defined?($value) ? (ref($value) ? @{$value} : $val ue) : (); ?if (@va?lues) { $self->add_parameter($name); push(@{$self->{$name}},?@values); } #return $seTXbslf->param($name); } EOF #, Method: delete?_all # Delete all parameters #+ 'delete_all' => <<'EOF', sub d?elete_all { !my($self) = self_or_default(@_); 9undef %{$sel?f}; } EOF 'Delete' => <<'EOF', sub Delete { $my($self,@p) = ?self_or_default(@_); ?$self->delete(@p); } EOF 'Delete_all' ?=> <<'EOF', sub Delete_all { my"($self,@p) = self_or_defaul?t(@_); $self->delete_all(@p); } EOF #? Method: autoescape ?# If you want to turn off the autoescaping ?features, # call th?is method with undeY@U{f as the argument 'autoEs+cape' => <<'END_OF_FUNC', ?sub autoEscape { )my($self,$escape) = self_or_default(@_); ?-$self->{'dontescape'}=!$escape; } END_OF_FUNC #. Method: ver?sion # Return the current version #- 'version' => <<'END_OF_FU?NC', sub version { ?return $VERSION; } END_OF_FUNC 'make_att?ributes' => <<'END_OF_FUNC', sub make_attributes { my($sel?f,$attr) = @_; >return () unless $attr && ref($attr) && ref($?attr) eq 'HASH'; my(@att); 9foreach (keys %{$attr}) { my(?$key) = $_ ]qEL$; $key=~s/^\-//; ?# get rid of initial - if present $key=~?tr/a-z_/A-Z-/; # param?eters are upper case, use dashes push(@?att,defined($attr->{$_}() ? qq/$key="$attr->{$_}"/ : qq/$key/);? } return @att; } END_OF_FUNC #? Method: url_param # Re?turn a parameter in the QUERY_STRING, re0gardless of # whether ?this was a POST or a GET ##1 'url_param' => <<'END_OF_FUNC', s?ub url_param { %my ($self,@p) = self_or_default(@_); my $n?ame = shift(@p); 0return undef unless exists($ENV{QUERY_STRIN?G!)ne{B}); ?unless (exists($self->{'.url_param'})) { $self->{'.url_param'}?5={}; # empty hash if ($ENV{QUERY_STRING} =~ /=/) { -my(@pa?irs) = split('&',$ENV{QUERY_STRING}); my($param,$value); ? ?foreach (@pairs) { ($param,$value) = split('=',$_,2); $pa?ra?m = unescape($param); $value = unescape($value); push(@{?$self->{'.url_param'}->{$param}},$value); } } else { ??$self->{'.url_param'}->{'keywords'} = [$self->parse_keywordlis?t($ENV{QUERY_STRING})]; } } {'.url?_param'}} unless defined($name); 1return () unless $self->{'.url_para?m'}->{$name}; 5return wantarray ? @{$self->{'.url_param'}->{$?name}} 6: $self->{'.url_param'}->{$name}->[0]; } END_OF_FUNC ? #? Method: dump # Returns a string in which all the known par?amet:er/value # pairs are represented as nested lists, mainly ?"for the purposes # of debugging. #' 'dump' => <<'END_OF_FUNC?', sub dump { !my($self) = self_or_default(@_); my($param,?$value,@result); (return '
    ' unless $#Jr]$self->param; ?push(@result,"
      "); ?foreach $param ($self->param) { my($name)=$se?lf->escapeHTML($p?aram); push(@result,"
    • $param"); push(@res7ult,"
        "); foreach $value ($self->param($?param)) { %$value = $self->escapeHTML($value); 7push(@res?ult,"
      • $value"); } push(@result,"
      "); } push(@re?sult,"
    \n"); *return join("\n",@result); } END_OF_FUNC ?#) Method as_string # # synonym for "dump" #1 'as_string' => <<'END_OF_FUNC', sub save { -my($self,$?filehandle) = self_or_default(@_); *$filehandle = to_filehand?le($filehandle); my($param); local($,) = ''4; # set prin?t field separator back to a sane value ?foreach $param ($self?->param) { my($escaped_param) = escape($p>aram); my($value); ? foreach $value ($self->param%qJ5}E($param)) { <<'END_OF_FUNC', sub save_paramet?ers { my $fh = shift; 0return save(to_filehandle($fh)); } ?END_OF_FUNC #? Method: restore_parameters # A way to restore ?CGI parameters f?rom&4[$O an initializer. # Only intended to be used? with the function (non-OO) interface. #? 'restore_parameters' => <<'?END_OF_FUNC', sub restore_parameters { 1$Q = $CGI::DefaultCl?ass->new(@_); } END_OF_FUNC #? Method: multipart_init # Retur?n a Content-Type: style header f?or server-push # This has to b?e NPH, and it is advisable to set $| = 1 # #? Many thanks to E?d Jordan for this # contribution #; 'multipa?rt_init' => <<'END_OF_FUNC', sub multipart_init { $my($self,@?p) = self_o'_XZbr_default(@_); 8my($boundary,@other) = $self->rear?range([BOUNDARY],@p); $boundary = $boundary || '- =_a0'; *$sel?f->{'separator'} = "\n--$boundary\n"; $type = SERVER_PUSH($b?oundary); ?return $self->header( -nph => 1, -type => $type,? (map { split "=", $_, 2 } @other), ') . $self->multipart_e?nd; } END_OF_FUNC # Meth?od: multipart_start # Return a Cont?ent-Type: style header for s?erver-push, start of section # # M?any thanks to Ed Jordan for this # contributi?on(Ԁ3T\ #= 'multipart_start' => <<'END_OF_FUNC', sub multipart_star?t { $my($self,@p) = self_or_default(@_); 0my($type,@other) = $self-?>rearrange([TYPE],@p); $type = $type || 'text/html'; ?retu?rn $self->header( -type => $type, (map { split "=", $_, 2 } ?@other), ); } END_OF_FUNC #5 Method: multipart_end # Retur?n a Content-Type: style? header for server-push, end of section? # # Many thanks to Ed J/ordan for this # cont?ribution #9 'multipart_end' => <<'END_OF_FUNC', sub mult)2µ;+8Suipart_?end { $my($self,@p) = self_or_default(@_); *return $self->{?'separator'}; } END_OF_FUNC #8 Method: header # Return a Content-Type?: style header # #+ 'header' => <<'END_OF_FUNC', sub header { ? $my($self,@p) = self_or_default(@_); my(@header); ?my($?type,$status,$cookie,$target,$expires,$nph,@other) = $self->?rearrange([TYPE,S1TATUS,[COOKIE,COOKIES],TARGET,EXPIRES,NPH],@p?); $nph ||= $NPH; 7# rearrange() was designed for the HTM?L portion, so we # need to fix it up a little* ֟.PDI. ?foreach (@?other) { next unless my($header,$value) = /([^\s=]+)?=\"?([^\"?]+)\"?/; ($_ = $header) =~ s/^(\w)(.*)/$1 . lc ($2) . ": $value"/e; ? } $type = $type || 'text/html'; *# Maybe future compat?ibility. Maybe not. 4my $protocol = $ENV{SERVER_PROTOCOL} ||? 'HTTP/1.0'; :push(@header,$protocol . ' ' . ($status || '200? OK')) if $nph; ,push(@header,"Status: $status") if $status?; 3push(@header,"Window-Target: $target") if $target; /# pu?sh all the cookies -- there may be seve+߿$f]jral ?if ($cookie) { m?y(@cookie) = ref($cookie) && ref($cookie) eq '5ARRAY' ? @{$cook?ie} : $cookie; foreach (@cookie) { ?push(@header,"Set-Cookie: " . (?UNIVERSAL::isa($_,'CGI::Cookie') ? $_->as_string : $_)); } ?} 9# if the user indicates an expiration time, then we need ? <# both an Expires and a Date header (so that the browser is ? # uses OUR clock) ?push(@header,"Expires: " . expires($ex?pires,'http')) if $expires; ?push(@header,"Date: " . expire?s(0,'http')) if $expires || $c, PtZ#30 ookie; 4push(@header,"Pragma: ?no-cache") if $self->cache(); push(@header,@other); &push(?@header,"Content-Type: $type"); 3my $header = join($CRLF,@header)."$?{CRLF}${CRLF}"; ?if ($MOD_PERL and not $nph) { my $r = Apach?e->request; $r->se$nd_cgi_header($header); return ''; } ?return $header; } END_OF_FUNC # Method: cache # Control w>h?ether header() will produce the no-cache # Pragma directive. #?) 'cache' => <<'END_OF_FUNC', sub cache { ,my($self,$new_valu?e) = self_or_default(-SeQ C@_); #$new_value = '' unless $new_value;? 8if ($new_value ne '') { $self->{'cache'} = $new_value; ?} &return $self->{'cache'}; } END_OF_FUNC #6 Method: redirect # Ret?urn a Location: style header # #/ 'redirect' => <<'END_OF_FUNC?', sub redirect { $my($self,@p) = self_or_default(@_); 6my(?$url,$target,$cookie,$nph,@other) = $self->rearrang.e([[LOCATIO?N,URI,URL],TARGET,COOKIE,NPH],@p); $url = $url || $self->sel?f_url; my(@o); 9foreach (@other) { tr/\"//d; push(@o,split?("=",$_,2));.x@w } ?unshift(@o, '-Status'=>'302 Moved', '-Loc?ation'=>$url, '- nph'=>$nph); +unshift(@o,'-Target'=>$targe?t) if $target; +unshift(@o,'-Cookie'=>$cookie) if $cookie; 'return ?$self->header(@o); } END_OF_FUNC #? Method: start_html # Cann?ed HTML header # # Parameters: # $tit?le -> (optional) The titl?e for this HTML document (-title) # $author -?> (optional) e-m?ail address of the author (-author) # $base -> ?(optional) if s?et to true, will enter the BASE address of this document # ?f?or /_T(resolving relative references (-base) # $xbase -> (optiona??l) alternative base at some remote location (-xbase) # $target ??-> (optional) target window to load all links into (-target) # ?$scrip?t -> (option) Javascript code (-script) # $no_script -> (?optio?n) Javascript