home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
perl501m.zip
/
patches
/
patch.1g
< prev
next >
Wrap
Text File
|
1995-05-31
|
66KB
|
2,450 lines
# This is my patch patch.1g for perl5.001. See description below.
# Andy Dougherty doughera@lafcol.lafayette.edu
#
# Please remove the following files before applying this patch.
# (You can feed this patch to 'sh' to do so.)
#
# These are now embedded in the appropriate .pm files.
#
rm -f pod/modpods/Abbrev.pod
rm -f pod/modpods/AnyDBMFile.pod
rm -f pod/modpods/AutoLoader.pod
rm -f pod/modpods/AutoSplit.pod
rm -f pod/modpods/Basename.pod
rm -f pod/modpods/Benchmark.pod
rm -f pod/modpods/Carp.pod
rm -f pod/modpods/CheckTree.pod
rm -f pod/modpods/Collate.pod
rm -f pod/modpods/Config.pod
rm -f pod/modpods/Cwd.pod
rm -f pod/modpods/DB_File.pod
rm -f pod/modpods/Dynaloader.pod
rm -f pod/modpods/English.pod
rm -f pod/modpods/Env.pod
rm -f pod/modpods/Exporter.pod
rm -f pod/modpods/Fcntl.pod
rm -f pod/modpods/FileHandle.pod
rm -f pod/modpods/Find.pod
rm -f pod/modpods/Finddepth.pod
rm -f pod/modpods/GetOptions.pod
rm -f pod/modpods/Getopt.pod
rm -f pod/modpods/MakeMaker.pod
rm -f pod/modpods/Open2.pod
rm -f pod/modpods/Open3.pod
rm -f pod/modpods/POSIX.pod
rm -f pod/modpods/Ping.pod
rm -f pod/modpods/Socket.pod
rm -f pod/modpods/integer.pod
rm -f pod/modpods/less.pod
rm -f pod/modpods/sigtrap.pod
rm -f pod/modpods/strict.pod
rm -f pod/modpods/subs.pod
# This directory should be empty now
rmdir pod/modpods
exit 0
This is my patch patch.1g for perl5.001.
This patch only includes updates to the lib/ directory and
the removal of the pod/modpods. The main things are the following:
The modpods are now embedded in their corresponding .pm files.
The Grand AutoLoader patch.
Updates to lib/ExtUtils/xsubpp by Paul Marquess
<pmarquess@bfsec.bt.co.uk>.
Minor changes to a very few modules and pods.
To apply, change to your perl directory, run the commands above, then
apply with
patch -p1 -N < thispatch.
After you apply this patch, you should go on to apply patch.1h and
patch.1i before reConfiguring and building.
Patch and enjoy,
Andy Dougherty doughera@lafcol.lafayette.edu
Dept. of Physics
Lafayette College, Easton PA
Here's the file-by-file description:
lib/AnyDBM_File.pm
Embedded pod.
lib/AutoLoader.pm
Grand AutoLoader patch.
Embedded pod.
lib/AutoSplit.pm
Grand AutoLoader patch.
Embedded pod.
Skip pod sections when splitting .pm files.
lib/Benchmark.pm
lib/Carp.pm
lib/Cwd.pm
lib/English.pm
Grand AutoLoader patch.
Embedded pod.
lib/Exporter.pm
Grand AutoLoader patch.
Embedded pod.
Update comments to match behavior.
lib/ExtUtils/MakeMaker.pm
Include installation of .pod and .pm files.
Space out documentation for better printing with pod2man.
lib/ExtUtils/xsubpp
Patches from Paul Marquess <pmarquess@bfsec.bt.co.uk>, 22 May 1995.
Now at version 1.4.
lib/File/Basename.pm
Embedded pod.
lib/File/CheckTree.pm
Embedded pod.
lib/File/Find.pm
Embedded pod.
Included finddepth pod too.
lib/FileHandle.pm
Embedded pod.
lib/Getopt/Long.pm
Embedded pod.
Fixed PERMUTE order bug.
lib/Getopt/Std.pm
Embedded pod.
Caught accessing undefined element off end of @arg array.
lib/I18N/Collate.pm
lib/IPC/Open2.pm
lib/IPC/Open3.pm
lib/Net/Ping.pm
Embedded pod.
lib/Term/Complete.pm
Embedded pod.
Changed name from complete to Complete to match documentation and
exported name.
lib/Text/Abbrev.pm
Embedded pod.
lib/Text/Tabs.pm
Updated.
lib/integer.pm
lib/less.pm
lib/sigtrap.pm
lib/strict.pm
lib/subs.pm
Embedded pod.
Index: lib/AnyDBM_File.pm
*** perl5.001f/lib/AnyDBM_File.pm Tue Oct 18 12:34:25 1994
--- perl5.001g/lib/AnyDBM_File.pm Thu May 25 11:11:34 1995
***************
*** 7,9 ****
--- 7,92 ----
eval { require GDBM_File } ||
eval { require SDBM_File } ||
eval { require ODBM_File };
+
+ =head1 NAME
+
+ AnyDBM_File - provide framework for multiple DBMs
+
+ NDBM_File, ODBM_File, SDBM_File, GDBM_File - various DBM implementations
+
+ =head1 SYNOPSIS
+
+ use AnyDBM_File;
+
+ =head1 DESCRIPTION
+
+ This module is a "pure virtual base class"--it has nothing of its own.
+ It's just there to inherit from one of the various DBM packages. It
+ prefers ndbm for compatibility reasons with Perl 4, then Berkeley DB (See
+ L<DB_File>), GDBM, SDBM (which is always there--it comes with Perl), and
+ finally ODBM. This way old programs that used to use NDBM via dbmopen()
+ can still do so, but new ones can reorder @ISA:
+
+ @AnyDBM_File::ISA = qw(DB_File GDBM_File NDBM_File);
+
+ Note, however, that an explicit use overrides the specified order:
+
+ use GDBM_File;
+ @AnyDBM_File::ISA = qw(DB_File GDBM_File NDBM_File);
+
+ will only find GDBM_File.
+
+ Having multiple DBM implementations makes it trivial to copy database formats:
+
+ use POSIX; use NDBM_File; use DB_File;
+ tie %newhash, DB_File, $new_filename, O_CREAT|O_RDWR;
+ tie %oldhash, NDBM_File, $old_filename, 1, 0;
+ %newhash = %oldhash;
+
+ =head2 DBM Comparisons
+
+ Here's a partial table of features the different packages 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/ many 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 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
+ Licensing restrictions ? ? no yes no
+
+
+ =over 4
+
+ =item [0]
+
+ on mixed universe machines, may be in the bsd compat library,
+ which is often shunned.
+
+ =item [1]
+
+ Can be trimmed if you compile for one access method.
+
+ =item [2]
+
+ See L<DB_File>.
+ Requires symbolic links.
+
+ =item [3]
+
+ By default, but can be redefined.
+
+ =back
+
+ =head1 SEE ALSO
+
+ dbm(3), ndbm(3), DB_File(3)
+
+ =cut
Index: lib/AutoLoader.pm
*** perl5.001f/lib/AutoLoader.pm Fri Jan 13 16:43:36 1995
--- perl5.001g/lib/AutoLoader.pm Thu May 25 14:33:45 1995
***************
*** 1,6 ****
--- 1,24 ----
package AutoLoader;
use Carp;
+ =head1 NAME
+
+ AutoLoader - load functions only on demand
+
+ =head1 SYNOPSIS
+
+ package FOOBAR;
+ use Exporter;
+ use AutoLoader;
+ @ISA = (Exporter, AutoLoader);
+
+ =head1 DESCRIPTION
+
+ This module tells its users that functions in the FOOBAR package are to be
+ autoloaded from F<auto/$AUTOLOAD.al>. See L<perlsub/"Autoloading">.
+
+ =cut
+
AUTOLOAD {
my $name = "auto/$AUTOLOAD.al";
$name =~ s#::#/#g;
***************
*** 23,28 ****
--- 41,64 ----
}
}
goto &$AUTOLOAD;
+ }
+
+ sub import
+ {
+ my ($callclass, $callfile, $callline,$path,$callpack) = caller(0);
+ ($callpack = $callclass) =~ s#::#/#;
+ if (defined($path = $INC{$callpack . '.pm'}))
+ {
+ if ($path =~ s#^(.*)$callpack\.pm$#$1auto/$callpack/autosplit.ix# && -e $path)
+ {
+ eval {require $path};
+ carp $@ if ($@);
+ }
+ else
+ {
+ croak "Have not loaded $callpack.pm";
+ }
+ }
}
1;
Index: lib/AutoSplit.pm
*** perl5.001f/lib/AutoSplit.pm Wed Feb 8 19:11:12 1995
--- perl5.001g/lib/AutoSplit.pm Thu May 25 14:55:47 1995
***************
*** 10,15 ****
--- 10,28 ----
@EXPORT = qw(&autosplit &autosplit_lib_modules);
@EXPORT_OK = qw($Verbose $Keep $Maxlen $CheckForAutoloader $CheckModTime);
+ =head1 NAME
+
+ AutoSplit - split a package for autoloading
+
+ =head1 DESCRIPTION
+
+ This function will split up your program into files that the AutoLoader
+ module can handle. Normally only used to build autoloading Perl library
+ modules, especially extensions (like POSIX). You should look at how
+ they're built out for details.
+
+ =cut
+
# for portability warn about names longer than $maxlen
$Maxlen = 8; # 8 for dos, 11 (14-".al") for SYSVR3
$Verbose = 1; # 0=none, 1=minimal, 2=list .al files
***************
*** 83,89 ****
--- 96,108 ----
open(IN, "<$filename") || die "AutoSplit: Can't open $filename: $!\n";
my($pm_mod_time) = (stat($filename))[9];
my($autoloader_seen) = 0;
+ my($in_pod) = 0;
while (<IN>) {
+ # Skip pod text.
+ $in_pod = 1 if /^=/;
+ $in_pod = 0 if /^=cut/;
+ next if ($in_pod || /^=cut/);
+
# record last package name seen
$package = $1 if (m/^\s*package\s+([\w:]+)\s*;/);
++$autoloader_seen if m/^\s*(use|require)\s+AutoLoader\b/;
***************
*** 199,205 ****
next if $names{substr($subname,0,$maxflen-3)};
my($file) = "$autodir/$modpname/$_";
print " deleting $file\n" if ($Verbose>=2);
! unlink $file or carp "Unable to delete $file: $!";
}
closedir(OUTDIR);
}
--- 218,226 ----
next if $names{substr($subname,0,$maxflen-3)};
my($file) = "$autodir/$modpname/$_";
print " deleting $file\n" if ($Verbose>=2);
! my($deleted,$thistime); # catch all versions on VMS
! do { $deleted += ($thistime = unlink $file) } while ($thistime);
! carp "Unable to delete $file: $!" unless $deleted;
}
closedir(OUTDIR);
}
***************
*** 207,213 ****
--- 228,236 ----
open(TS,">$al_idx_file") or
carp "AutoSplit: unable to create timestamp file ($al_idx_file): $!";
print TS "# Index created by AutoSplit for $filename (file acts as timestamp)\n";
+ print TS "package $package;\n";
print TS map("sub $_ ;\n", @subnames);
+ print TS "1;\n";
close(TS);
check_unique($package, $Maxlen, 1, @names);
Index: lib/Benchmark.pm
*** perl5.001f/lib/Benchmark.pm Tue Oct 18 12:34:33 1994
--- perl5.001g/lib/Benchmark.pm Thu May 25 11:15:48 1995
***************
*** 1,5 ****
--- 1,166 ----
package Benchmark;
+ =head1 NAME
+
+ Benchmark - benchmark running times of code
+
+ timethis - run a chunk of code several times
+
+ timethese - run several chunks of code several times
+
+ timeit - run a chunk of code and see how long it goes
+
+ =head1 SYNOPSIS
+
+ timethis ($count, "code");
+
+ timethese($count, {
+ 'Name1' => '...code1...',
+ 'Name2' => '...code2...',
+ });
+
+ $t = timeit($count, '...other code...')
+ print "$count loops of other code took:",timestr($t),"\n";
+
+ =head1 DESCRIPTION
+
+ The Benchmark module encapsulates a number of routines to help you
+ figure out how long it takes to execute some code.
+
+ =head2 Methods
+
+ =over 10
+
+ =item new
+
+ Returns the current time. Example:
+
+ use Benchmark;
+ $t0 = new Benchmark;
+ # ... your code here ...
+ $t1 = new Benchmark;
+ $td = timediff($t1, $t0);
+ print "the code took:",timestr($dt),"\n";
+
+ =item debug
+
+ Enables or disable debugging by setting the C<$Benchmark::Debug> flag:
+
+ debug Benchmark 1;
+ $t = timeit(10, ' 5 ** $Global ');
+ debug Benchmark 0;
+
+ =back
+
+ =head2 Standard Exports
+
+ The following routines will be exported into your namespace
+ if you use the Benchmark module:
+
+ =over 10
+
+ =item timeit(COUNT, CODE)
+
+ Arguments: COUNT is the number of time to run the loop, and
+ the second is the code to run. CODE may be a string containing the code,
+ a reference to the function to run, or a reference to a hash containing
+ keys which are names and values which are more CODE specs.
+
+ Side-effects: prints out noise to standard out.
+
+ Returns: a Benchmark object.
+
+ =item timethis
+
+ =item timethese
+
+ =item timediff
+
+ =item timestr
+
+ =back
+
+ =head2 Optional Exports
+
+ The following routines will be exported into your namespace
+ if you specifically ask that they be imported:
+
+ =over 10
+
+ clearcache
+
+ clearallcache
+
+ disablecache
+
+ enablecache
+
+ =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 seconds for the whole loop (not divided by the number of rounds).
+
+ The timing is done using time(3) and times(3).
+
+ Code is executed in the caller's package.
+
+ Enable debugging by:
+
+ $Benchmark::debug = 1;
+
+ The time of the null loop (a loop with the same
+ number of rounds but empty loop body) is subtracted
+ from the time of the real loop.
+
+ The null loop times are cached, the key being the
+ number of rounds. The caching can be controlled using
+ calls like these:
+
+ clearcache($key);
+ clearallcache();
+
+ disablecache();
+ enablecache();
+
+ =head1 INHERITANCE
+
+ Benchmark inherits from no other class, except of course
+ for Exporter.
+
+ =head1 CAVEATS
+
+ The real time timing is done using time(2) and
+ the granularity is therefore only one second.
+
+ Short tests may produce negative figures because perl
+ 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 might be slightly
+ more than the system time of the loop with the actual
+ code and therefore the difference might end up being < 0.
+
+ More documentation is needed :-( especially for styles and formats.
+
+ =head1 AUTHORS
+
+ Jarkko Hietaniemi <Jarkko.Hietaniemi@hut.fi>,
+ Tim Bunce <Tim.Bunce@ig.co.uk>
+
+ =head1 MODIFICATION HISTORY
+
+ September 8th, 1994; by Tim Bunce.
+
+ =cut
+
# Purpose: benchmark running times of code.
#
#
Index: lib/Carp.pm
*** perl5.001f/lib/Carp.pm Sun Mar 12 21:41:15 1995
--- perl5.001g/lib/Carp.pm Thu May 25 11:16:07 1995
***************
*** 1,5 ****
--- 1,29 ----
package Carp;
+ =head1 NAME
+
+ carp - warn of errors (from perspective of caller)
+
+ croak - die of errors (from perspective of caller)
+
+ confess - die of errors with stack backtrace
+
+ =head1 SYNOPSIS
+
+ use Carp;
+ croak "We're outta here!";
+
+ =head1 DESCRIPTION
+
+ The Carp routines are useful in your own modules because
+ they act like die() or warn(), but report where the error
+ was in the code they were called from. Thus if you have a
+ routine Foo() that has a carp() in it, then the carp()
+ will report the error as occurring where Foo() was called,
+ not where carp() was called.
+
+ =cut
+
# This package implements handy routines for modules that wish to throw
# exceptions outside of the current package.
Index: lib/Cwd.pm
*** perl5.001f/lib/Cwd.pm Mon Mar 6 22:19:33 1995
--- perl5.001g/lib/Cwd.pm Thu May 25 11:16:34 1995
***************
*** 3,8 ****
--- 3,37 ----
require Exporter;
use Config;
+ =head1 NAME
+
+ getcwd - get pathname of current working directory
+
+ =head1 SYNOPSIS
+
+ require Cwd;
+ $dir = Cwd::getcwd();
+
+ use Cwd;
+ $dir = getcwd();
+
+ use Cwd 'chdir';
+ chdir "/tmp";
+ print $ENV{'PWD'};
+
+ =head1 DESCRIPTION
+
+ The getcwd() function re-implements the getcwd(3) (or getwd(3)) functions
+ in Perl. If you ask to override your chdir() built-in function, then your
+ PWD environment variable will be kept up to date. (See
+ L<perlsub/Overriding builtin functions>.)
+
+ The fastgetcwd() function looks the same as getcwd(), but runs faster.
+ It's also more dangerous because you might conceivably chdir() out of a
+ directory that you can't chdir() back into.
+
+ =cut
+
@ISA = qw(Exporter);
@EXPORT = qw(getcwd fastcwd);
@EXPORT_OK = qw(chdir);
Index: lib/English.pm
*** perl5.001f/lib/English.pm Tue Feb 21 19:39:05 1995
--- perl5.001g/lib/English.pm Thu May 25 11:17:06 1995
***************
*** 3,8 ****
--- 3,34 ----
require Exporter;
@ISA = (Exporter);
+ =head1 NAME
+
+ English - use nice English (or awk) names for ugly punctuation variables
+
+ =head1 SYNOPSIS
+
+ use English;
+ ...
+ if ($ERRNO =~ /denied/) { ... }
+
+ =head1 DESCRIPTION
+
+ This module provides aliases for the built-in variables whose
+ names no one seems to like to read. Variables with side-effects
+ which get triggered just by accessing them (like $0) will still
+ be affected.
+
+ For those variables that have an B<awk> version, both long
+ and short English alternatives are provided. For example,
+ the C<$/> variable can be referred to either $RS or
+ $INPUT_RECORD_SEPARATOR if you are using the English module.
+
+ See L<perlvar> for a complete list of these.
+
+ =cut
+
local $^W = 0;
# Grandfather $NAME import
Index: lib/Exporter.pm
*** perl5.001f/lib/Exporter.pm Sun Mar 12 21:39:16 1995
--- perl5.001g/lib/Exporter.pm Thu May 25 11:17:47 1995
***************
*** 2,32 ****
=head1 Comments
! If the first entry in an import list begins with /, ! or : then
! treat the list as a series of specifications which either add to
! or delete from the list of names to import. They are processed
! left to right. Specifications are in the form:
- [!]/pattern/ All names in @EXPORT and @EXPORT_OK which match
[!]name This name only
- [!]:tag All names in $EXPORT_TAGS{":tag"}
[!]:DEFAULT All names in @EXPORT
! e.g., Foo.pm defines:
@EXPORT = qw(A1 A2 A3 A4 A5);
@EXPORT_OK = qw(B1 B2 B3 B4 B5);
! %EXPORT_TAGS = (':T1' => [qw(A1 A2 B1 B2)], ':T2' => [qw(A1 A2 B3 B4)]);
Note that you cannot use tags in @EXPORT or @EXPORT_OK.
Names in EXPORT_TAGS must also appear in @EXPORT or @EXPORT_OK.
Application says:
! use Module qw(:T2 !B3 A3);
use Socket qw(!/^[AP]F_/ !SOMAXCONN !SOL_SOCKET);
use POSIX qw(/^S_/ acos asin atan /^E/ !/^EXIT/);
=cut
require 5.001;
--- 2,41 ----
=head1 Comments
! If the first entry in an import list begins with !, : or / then the
! list is treated as a series of specifications which either add to or
! delete from the list of names to import. They are processed left to
! right. Specifications are in the form:
[!]name This name only
[!]:DEFAULT All names in @EXPORT
+ [!]:tag All names in $EXPORT_TAGS{tag} anonymous list
+ [!]/pattern/ All names in @EXPORT and @EXPORT_OK which match
! A leading ! indicates that matching names should be deleted from the
! list of names to import. If the first specification is a deletion it
! is treated as though preceded by :DEFAULT. If you just want to import
! extra names in addition to the default set you will still need to
! include :DEFAULT explicitly.
!
! e.g., Module.pm defines:
@EXPORT = qw(A1 A2 A3 A4 A5);
@EXPORT_OK = qw(B1 B2 B3 B4 B5);
! %EXPORT_TAGS = (T1 => [qw(A1 A2 B1 B2)], T2 => [qw(A1 A2 B3 B4)]);
Note that you cannot use tags in @EXPORT or @EXPORT_OK.
Names in EXPORT_TAGS must also appear in @EXPORT or @EXPORT_OK.
Application says:
! use Module qw(:DEFAULT :T2 !B3 A3);
use Socket qw(!/^[AP]F_/ !SOMAXCONN !SOL_SOCKET);
use POSIX qw(/^S_/ acos asin atan /^E/ !/^EXIT/);
+ You can set C<$Exporter::Verbose=1;> to see how the specifications are
+ being processed and what is actually being imported into modules.
+
=cut
require 5.001;
***************
*** 110,116 ****
}
}
}
! die "Can't continue with import errors.\n" if $oops;
}
else {
@imports = @exports;
--- 119,125 ----
}
}
}
! Carp::croak("Can't continue with import errors.\n") if $oops;
}
else {
@imports = @exports;
Index: lib/ExtUtils/MakeMaker.pm
*** perl5.001f/lib/ExtUtils/MakeMaker.pm Tue Apr 18 09:51:17 1995
--- perl5.001g/lib/ExtUtils/MakeMaker.pm Tue May 30 14:56:48 1995
***************
*** 1,6 ****
package ExtUtils::MakeMaker;
! $Version = 4.094; # Last edited 17 Apr 1995 by Andy Dougherty
use Config;
use Carp;
--- 1,6 ----
package ExtUtils::MakeMaker;
! $Version = 4.095; # Last edited 17 Apr 1995 by Andy Dougherty
use Config;
use Carp;
***************
*** 835,841 ****
}
! sub init_dirscan { # --- File and Directory Lists (.xs .pm etc)
my($name, %dir, %xs, %c, %h, %ignore, %pl_files);
local(%pm); #the sub in find() has to see this hash
--- 835,841 ----
}
! sub init_dirscan { # --- File and Directory Lists (.xs .pm .pod etc)
my($name, %dir, %xs, %c, %h, %ignore, %pl_files);
local(%pm); #the sub in find() has to see this hash
***************
*** 853,859 ****
$c{$name} = 1;
} elsif ($name =~ /\.h$/){
$h{$name} = 1;
! } elsif ($name =~ /\.p[ml]$/){
$pm{$name} = "\$(INST_LIBDIR)/$name";
} elsif ($name =~ /\.PL$/ && $name ne "Makefile.PL") {
($pl_files{$name} = $name) =~ s/\.PL$// ;
--- 853,859 ----
$c{$name} = 1;
} elsif ($name =~ /\.h$/){
$h{$name} = 1;
! } elsif ($name =~ /\.(p[ml]|pod)$/){
$pm{$name} = "\$(INST_LIBDIR)/$name";
} elsif ($name =~ /\.PL$/ && $name ne "Makefile.PL") {
($pl_files{$name} = $name) =~ s/\.PL$// ;
***************
*** 2336,2362 ****
--- 2336,2384 ----
=head1 MODIFICATION HISTORY
v1, August 1994; by Andreas Koenig. Based on Andy Dougherty's Makefile.SH.
+
v2, September 1994 by Tim Bunce.
+
v3.0 October 1994 by Tim Bunce.
+
v3.1 November 11th 1994 by Tim Bunce.
+
v3.2 November 18th 1994 by Tim Bunce.
+
v3.3 November 27th 1994 by Andreas Koenig.
+
v3.4 December 7th 1994 by Andreas Koenig and Tim Bunce.
+
v3.5 December 15th 1994 by Tim Bunce.
+
v3.6 December 15th 1994 by Tim Bunce.
+
v3.7 December 30th 1994 By Tim Bunce
+
v3.8 January 17th 1995 By Andreas Koenig and Tim Bunce
+
v3.9 January 19th 1995 By Tim Bunce
+
v3.10 January 23rd 1995 By Tim Bunce
+
v3.11 January 24th 1995 By Andreas Koenig
+
v4.00 January 24th 1995 By Tim Bunce
+
v4.01 January 25th 1995 By Tim Bunce
+
v4.02 January 29th 1995 By Andreas Koenig
+
v4.03 January 30th 1995 By Andreas Koenig
+
v4.04 Februeary 5th 1995 By Andreas Koenig
+
v4.05 February 8th 1995 By Andreas Koenig
+
v4.06 February 10th 1995 By Andreas Koenig
+
v4.061 February 12th 1995 By Andreas Koenig
+
v4.08 - 4.085 February 14th-21st 1995 by Andreas Koenig
Introduces EXE_FILES and INST_EXE for installing executable scripts
***************
*** 2384,2390 ****
old_extliblist() code deleted, new_extliblist() renamed to extliblist().
Improved algorithm in extliblist, that returns ('','','') if no
! library has been found, even if a -L directory has been found.
Fixed a bug that didn't allow lib/ directory work as documented.
--- 2406,2412 ----
old_extliblist() code deleted, new_extliblist() renamed to extliblist().
Improved algorithm in extliblist, that returns ('','','') if no
! library has been found, even if a C<-L> directory has been found.
Fixed a bug that didn't allow lib/ directory work as documented.
***************
*** 2436,2442 ****
Another attempt to fix writedoc() from Dean Roehrich.
! v4.092 April 11 1994 by Andreas Koenig
Fixed a docu bug in hint file description. Added printing of a warning
from eval in the hintfile section if the eval has errors. Moved
--- 2458,2464 ----
Another attempt to fix writedoc() from Dean Roehrich.
! v4.092 April 11 1995 by Andreas Koenig
Fixed a docu bug in hint file description. Added printing of a warning
from eval in the hintfile section if the eval has errors. Moved
***************
*** 2456,2462 ****
Minor cosmetics.
! v4.093 April 12 1994 by Andy Dougherty
Rename distclean target to plain dist. Insert a dummy distclean
target that's the same as realclean. This is more consistent with the
--- 2478,2484 ----
Minor cosmetics.
! v4.093 April 12 1995 by Andy Dougherty
Rename distclean target to plain dist. Insert a dummy distclean
target that's the same as realclean. This is more consistent with the
***************
*** 2468,2476 ****
Include Tim's suggestions about $verbose and more careful substitution
of $(CC) for $Config{'cc'}.
! v4.094 April 12 1994 by Andy Dougherty
Include Andreas' improvement of $(CC) detection.
=head1 NOTES
--- 2490,2504 ----
Include Tim's suggestions about $verbose and more careful substitution
of $(CC) for $Config{'cc'}.
! v4.094 April 12 1995 by Andy Dougherty
Include Andreas' improvement of $(CC) detection.
+
+ v4.095 May 30 1995 by Andy Dougherty
+
+ Include installation of .pod and .pm files.
+
+ Space out documentation for better printing with pod2man.
=head1 NOTES
Index: lib/ExtUtils/xsubpp
*** perl5.001f/lib/ExtUtils/xsubpp Mon Mar 6 19:59:27 1995
--- perl5.001g/lib/ExtUtils/xsubpp Fri May 26 15:24:22 1995
***************
*** 50,61 ****
--- 50,146 ----
Larry Wall
+ =head1 MODIFICATION HISTORY
+
+ =head2 1.0
+
+ I<xsubpp> as released with Perl 5.000
+
+ =head2 1.1
+
+ I<xsubpp> as released with Perl 5.001
+
+ =head2 1.2
+
+ Changes by Paul Marquess <pmarquess@bfsec.bt.co.uk>, 22 May 1995.
+
+ =over 5
+
+ =item 1.
+
+ Added I<xsubpp> version number for the first time. As previous releases
+ of I<xsubpp> did not have a formal version number, a numbering scheme
+ has been applied retrospectively.
+
+ =item 2.
+
+ If OUTPUT: is being used to specify output parameters and RETVAL is
+ also to be returned, it is now no longer necessary for the user to
+ ensure that RETVAL is specified last.
+
+ =item 3.
+
+ The I<xsubpp> version number, the .xs filename and a time stamp are
+ written to the generated .c file as a comment.
+
+ =item 4.
+
+ When I<xsubpp> is parsing the definition of both the input parameters
+ and the OUTPUT parameters, any duplicate definitions will be noted and
+ ignored.
+
+ =item 5.
+
+ I<xsubpp> is slightly more forgiving with extra whitespace.
+
+ =back
+
+ =head2 1.3
+
+ Changes by Paul Marquess <pmarquess@bfsec.bt.co.uk>, 23 May 1995.
+
+ =over 5
+
+ =item 1.
+
+ More whitespace restrictions have been relaxed. In particular some
+ cases where a tab character was used to delimit fields has been
+ removed. In these cases any whitespace will now suffice.
+
+ The specific places where changes have been made are in the TYPEMAP
+ section of a typemap file and the input and OUTPUT: parameter
+ declarations sections in a .xs file.
+
+ =item 2.
+
+ More error checking added.
+
+ Before processing each typemap file I<xsubpp> now checks that it is a
+ text file. If not an warning will be displayed. In addition, a warning
+ will be displayed if it is not possible to open the typemap file.
+
+ In the TYPEMAP section of a typemap file, an error will be raised if
+ the line does not have 2 columns.
+
+ When parsing input parameter declarations check that there is at least
+ a type and name pair.
+
+ =back
+
+ =head2 1.4
+
+ When parsing the OUTPUT arguments check that they are all present in
+ the corresponding input argument definitions.
+
=head1 SEE ALSO
perl(1)
=cut
+ # Global Constants
+ $XSUBPP_version = "1.4" ;
+
$usage = "Usage: xsubpp [-C++] [-except] [-typemap typemap] file.xs\n";
SWITCH: while ($ARGV[0] =~ s/^-//) {
***************
*** 75,80 ****
--- 160,186 ----
or ($dir, $filename) = ('.', $ARGV[0]);
chdir($dir);
+ sub TrimWhitespace
+ {
+ $_[0] =~ s/^\s+|\s+$//go ;
+ }
+
+ sub TidyType
+ {
+ local ($_) = @_ ;
+
+ # rationalise any '*' by joining them into bunches and removing whitespace
+ s#\s*(\*+)\s*#$1#g;
+
+ # change multiple whitespace into a single space
+ s/\s+/ /g ;
+
+ # trim leading & trailing whitespace
+ TrimWhitespace($_) ;
+
+ $_ ;
+ }
+
$typemap = shift @ARGV;
foreach $typemap (@tm) {
die "Can't find $typemap in $pwd\n" unless -r $typemap;
***************
*** 83,89 ****
../../lib/ExtUtils/typemap ../../../typemap ../../typemap
../typemap typemap);
foreach $typemap (@tm) {
! open(TYPEMAP, $typemap) || next;
$mode = Typemap;
$current = \$junk;
while (<TYPEMAP>) {
--- 189,200 ----
../../lib/ExtUtils/typemap ../../../typemap ../../typemap
../typemap typemap);
foreach $typemap (@tm) {
! next unless -e $typemap ;
! # skip directories, binary files etc.
! warn("Warning: ignoring non-text typemap file '$typemap'\n"), next
! unless -T $typemap ;
! open(TYPEMAP, $typemap)
! or warn ("Warning: could not open typemap file '$typemap': $!\n"), next;
$mode = Typemap;
$current = \$junk;
while (<TYPEMAP>) {
***************
*** 93,100 ****
if (/^TYPEMAP\s*$/) { $mode = Typemap, next }
if ($mode eq Typemap) {
chop;
! ($typename, $kind) = split(/\t+/, $_, 2);
! $type_kind{$typename} = $kind if $kind ne '';
}
elsif ($mode eq Input) {
if (/^\s/) {
--- 204,219 ----
if (/^TYPEMAP\s*$/) { $mode = Typemap, next }
if ($mode eq Typemap) {
chop;
! my $line = $_ ;
! TrimWhitespace($_) ;
! # skip blank lines and comment lines
! next if /^$/ or /^#/ ;
! my @words = split (' ') ;
! blurt("Error: File '$typemap' Line $. '$line' TYPEMAP entry needs 2 columns\n"), next
! unless @words >= 2 ;
! my $kind = pop @words ;
! TrimWhitespace($kind) ;
! $type_kind{TidyType("@words")} = $kind ;
}
elsif ($mode eq Input) {
if (/^\s/) {
***************
*** 132,138 ****
$text;
}
! open(F, $filename) || die "cannot open $filename\n";
while (<F>) {
last if ($Module, $foo, $Package, $foo1, $Prefix) =
--- 251,269 ----
$text;
}
! # Identify the version of xsubpp used
! $TimeStamp = localtime ;
! print <<EOM ;
! /*
! * This file was generated automatically by xsubpp version $XSUBPP_version
! * from $filename on $TimeStamp
! *
! */
!
! EOM
!
!
! open(F, $filename) or die "cannot open $filename: $!\n";
while (<F>) {
last if ($Module, $foo, $Package, $foo1, $Prefix) =
***************
*** 196,204 ****
undef($class);
undef($static);
undef($elipsis);
# extract return type, function name and arguments
! $ret_type = shift(@line);
if ($ret_type =~ /^BOOT:/) {
push (@BootCode, @line, "", "") ;
next ;
--- 327,337 ----
undef($class);
undef($static);
undef($elipsis);
+ undef($wantRETVAL) ;
+ undef(%arg_list) ;
# extract return type, function name and arguments
! $ret_type = TidyType(shift(@line));
if ($ret_type =~ /^BOOT:/) {
push (@BootCode, @line, "", "") ;
next ;
***************
*** 325,335 ****
$_ = shift(@line);
last if /^\s*NOT_IMPLEMENTED_YET/;
last if /^\s*(PPCODE|CODE|OUTPUT|CLEANUP|CASE)\s*:/;
! ($var_type, $var_name, $var_init) =
! /\s*([^\t]+)\s*([^\s=]+)\s*(=.*)?/;
! # Catch common errors. More error checking required here.
! blurt("Error: no tab in $pname argument declaration '$_'\n")
! unless (m/\S+\s*\t\s*\S+/);
# catch C style argument declaration (this could be made alowable syntax)
warn("Warning: ignored semicolon in $pname argument declaration '$_'\n")
if ($var_name =~ s/;//g); # eg SV *<tab>name;
--- 458,477 ----
$_ = shift(@line);
last if /^\s*NOT_IMPLEMENTED_YET/;
last if /^\s*(PPCODE|CODE|OUTPUT|CLEANUP|CASE)\s*:/;
!
! TrimWhitespace($_) ;
! # skip blank lines
! next if /^$/ ;
! my $line = $_ ;
! # check for optional initialisation code
! my $var_init = $1 if s/\s*(=.*)$// ;
!
! my @words = split (' ') ;
! blurt("Error: invalid argument declaration '$line'"), next
! unless @words >= 2 ;
! my $var_name = pop @words ;
! my $var_type = "@words" ;
!
# catch C style argument declaration (this could be made alowable syntax)
warn("Warning: ignored semicolon in $pname argument declaration '$_'\n")
if ($var_name =~ s/;//g); # eg SV *<tab>name;
***************
*** 340,345 ****
--- 482,492 ----
$var_name =~ s/^&//;
$var_addr{$var_name} = 1;
}
+
+ # Check for duplicate definitions
+ blurt ("Error: duplicate definition of argument '$var_name' ignored"), next
+ if $arg_list{$var_name} ++ ;
+
$thisdone |= $var_name eq "THIS";
$retvaldone |= $var_name eq "RETVAL";
$var_types{$var_name} = $var_type;
***************
*** 425,453 ****
$func_name = $2;
}
print "$func_name($func_args);\n";
! &generate_output($ret_type, 0, "RETVAL")
! unless $ret_type eq "void";
}
}
# do output variables
if (/^\s*OUTPUT\s*:/) {
while (@line) {
$_ = shift(@line);
last if /^\s*CLEANUP\s*:/;
! s/^\s+//;
! ($outarg, $outcode) = split(/\t+/);
if ($outcode) {
print "\t$outcode\n";
} else {
- die "$outarg not an argument"
- unless defined($args_match{$outarg});
$var_num = $args_match{$outarg};
&generate_output($var_types{$outarg}, $var_num,
$outarg);
}
}
}
# do cleanup
if (/^\s*CLEANUP\s*:/) {
while (@line) {
--- 572,619 ----
$func_name = $2;
}
print "$func_name($func_args);\n";
! $wantRETVAL = 1
! unless $ret_type eq "void";
}
}
# do output variables
if (/^\s*OUTPUT\s*:/) {
+ my $gotRETVAL ;
+ my %outargs ;
while (@line) {
$_ = shift(@line);
last if /^\s*CLEANUP\s*:/;
! TrimWhitespace($_) ;
! next if /^$/ ;
! my ($outarg, $outcode) = /^(\S+)\s*(.*)/ ;
! if (!$gotRETVAL and $outarg eq 'RETVAL') {
! # deal with RETVAL last
! push(@line, $_) ;
! $gotRETVAL = 1 ;
! undef ($wantRETVAL) ;
! next ;
! }
! blurt ("Error: duplicate OUTPUT argument '$outarg' ignored"), next
! if $outargs{$outarg} ++ ;
! blurt ("Error: OUTPUT $outarg not an argument"), next
! unless defined($args_match{$outarg});
! blurt("Error: No input definition for OUTPUT argument '$outarg' - ignored"), next
! unless defined $var_types{$outarg} ;
if ($outcode) {
print "\t$outcode\n";
} else {
$var_num = $args_match{$outarg};
&generate_output($var_types{$outarg}, $var_num,
$outarg);
}
}
}
+
+ # all OUTPUT done, so now push the return value on the stack
+ &generate_output($ret_type, 0, "RETVAL")
+ if $wantRETVAL ;
+
# do cleanup
if (/^\s*CLEANUP\s*:/) {
while (@line) {
***************
*** 533,539 ****
local($ntype);
local($tk);
! blurt("'$type' not in typemap"), return unless defined($type_kind{$type});
($ntype = $type) =~ s/\s*\*/Ptr/g;
$subtype = $ntype;
$subtype =~ s/Ptr$//;
--- 699,706 ----
local($ntype);
local($tk);
! $type = TidyType($type) ;
! blurt("Error: '$type' not in typemap"), return unless defined($type_kind{$type});
($ntype = $type) =~ s/\s*\*/Ptr/g;
$subtype = $ntype;
$subtype =~ s/Ptr$//;
***************
*** 570,579 ****
local($argoff) = $num - 1;
local($ntype);
if ($type =~ /^array\(([^,]*),(.*)\)/) {
print "\tsv_setpvn($arg, (char *)$var, $2 * sizeof($1)), XFree((char *)$var);\n";
} else {
! blurt("'$type' not in typemap"), return
unless defined($type_kind{$type});
($ntype = $type) =~ s/\s*\*/Ptr/g;
$ntype =~ s/\(\)//g;
--- 737,747 ----
local($argoff) = $num - 1;
local($ntype);
+ $type = TidyType($type) ;
if ($type =~ /^array\(([^,]*),(.*)\)/) {
print "\tsv_setpvn($arg, (char *)$var, $2 * sizeof($1)), XFree((char *)$var);\n";
} else {
! blurt("Error: '$type' not in typemap"), return
unless defined($type_kind{$type});
($ntype = $type) =~ s/\s*\*/Ptr/g;
$ntype =~ s/\(\)//g;
Index: lib/File/Basename.pm
*** perl5.001f/lib/File/Basename.pm Sun Mar 12 03:14:03 1995
--- perl5.001g/lib/File/Basename.pm Thu May 25 15:10:28 1995
***************
*** 1,5 ****
--- 1,116 ----
package File::Basename;
+ =head1 NAME
+
+ Basename - parse file specifications
+
+ fileparse - split a pathname into pieces
+
+ basename - extract just the filename from a path
+
+ dirname - extract just the directory from a path
+
+ =head1 SYNOPSIS
+
+ use File::Basename;
+
+ ($name,$path,$suffix) = fileparse($fullname,@suffixlist)
+ fileparse_set_fstype($os_string);
+ $basename = basename($fullname,@suffixlist);
+ $dirname = dirname($fullname);
+
+ ($name,$path,$suffix) = fileparse("lib/File/Basename.pm","\.pm");
+ fileparse_set_fstype("VMS");
+ $basename = basename("lib/File/Basename.pm",".pm");
+ $dirname = dirname("lib/File/Basename.pm");
+
+ =head1 DESCRIPTION
+
+ These routines allow you to parse file specifications into useful
+ pieces using the syntax of different operating systems.
+
+ =over 4
+
+ =item fileparse_set_fstype
+
+ You select the syntax via the routine fileparse_set_fstype().
+ If the argument passed to it contains one of the substrings
+ "VMS", "MSDOS", or "MacOS", the file specification syntax of that
+ operating system is used in future calls to fileparse(),
+ basename(), and dirname(). If it contains none of these
+ substrings, UNIX syntax is used. This pattern matching is
+ case-insensitive. If you've selected VMS syntax, and the file
+ specification you pass to one of these routines contains a "/",
+ they assume you are using UNIX emulation and apply the UNIX syntax
+ rules instead, for that function call only.
+
+ If you haven't called fileparse_set_fstype(), the syntax is chosen
+ by examining the "osname" entry from the C<Config> package
+ according to these rules.
+
+ =item fileparse
+
+ The fileparse() routine divides a file specification into three
+ parts: a leading B<path>, a file B<name>, and a B<suffix>. The
+ B<path> contains everything up to and including the last directory
+ separator in the input file specification. The remainder of the input
+ file specification is then divided into B<name> and B<suffix> based on
+ the optional patterns you specify in C<@suffixlist>. Each element of
+ this list is interpreted as a regular expression, and is matched
+ against the end of B<name>. If this succeeds, the matching portion of
+ B<name> is removed and prepended to B<suffix>. By proper use of
+ C<@suffixlist>, you can remove file types or versions for examination.
+
+ You are guaranteed that if you concatenate B<path>, B<name>, and
+ B<suffix> together in that order, the result will be identical to the
+ input file specification.
+
+ =back
+
+ =head1 EXAMPLES
+
+ Using UNIX file syntax:
+
+ ($base,$path,$type) = fileparse('/virgil/aeneid/draft.book7',
+ '\.book\d+');
+
+ would yield
+
+ $base eq 'draft'
+ $path eq '/virgil/aeneid',
+ $tail eq '.book7'
+
+ Similarly, using VMS syntax:
+
+ ($name,$dir,$type) = fileparse('Doc_Root:[Help]Rhetoric.Rnh',
+ '\..*');
+
+ would yield
+
+ $name eq 'Rhetoric'
+ $dir eq 'Doc_Root:[Help]'
+ $type eq '.Rnh'
+
+ =item C<basename>
+
+ The basename() routine returns the first element of the list produced
+ by calling fileparse() with the same arguments. It is provided for
+ compatibility with the UNIX shell command basename(1).
+
+ =item C<dirname>
+
+ The dirname() routine returns the directory portion of the input file
+ specification. When using VMS or MacOS syntax, this is identical to the
+ second element of the list produced by calling fileparse() with the same
+ input file specification. When using UNIX or MSDOS syntax, the return
+ value conforms to the behavior of the UNIX shell command dirname(1). This
+ is usually the same as the behavior of fileparse(), but differs in some
+ cases. For example, for the input file specification F<lib/>, fileparse()
+ considers the directory name to be F<lib/>, while dirname() considers the
+ directory name to be F<.>).
+
+ =cut
+
require 5.000;
use Config;
require Exporter;
***************
*** 62,68 ****
sub fileparse {
my($fullname,@suffices) = @_;
my($fstype) = $Fileparse_fstype;
! my($dirpath,$tail,$suffix,$idx);
if ($fstype =~ /^VMS/i) {
if ($fullname =~ m#/#) { $fstype = '' } # We're doing Unix emulation
--- 173,179 ----
sub fileparse {
my($fullname,@suffices) = @_;
my($fstype) = $Fileparse_fstype;
! my($dirpath,$tail,$suffix);
if ($fstype =~ /^VMS/i) {
if ($fullname =~ m#/#) { $fstype = '' } # We're doing Unix emulation
***************
*** 84,89 ****
--- 195,201 ----
}
if (@suffices) {
+ $tail = '';
foreach $suffix (@suffices) {
if ($basename =~ /($suffix)$/) {
$tail = $1 . $tail;
Index: lib/File/CheckTree.pm
*** perl5.001f/lib/File/CheckTree.pm Mon Jan 16 23:41:00 1995
--- perl5.001g/lib/File/CheckTree.pm Thu May 25 11:23:32 1995
***************
*** 2,7 ****
--- 2,46 ----
require 5.000;
require Exporter;
+ =head1 NAME
+
+ validate - run many filetest checks on a tree
+
+ =head1 SYNOPSIS
+
+ use File::CheckTree;
+
+ $warnings += validate( q{
+ /vmunix -e || die
+ /boot -e || die
+ /bin cd
+ csh -ex
+ csh !-ug
+ sh -ex
+ sh !-ug
+ /usr -d || warn "What happened to $file?\n"
+ });
+
+ =head1 DESCRIPTION
+
+ The validate() routine takes a single multiline string consisting of
+ lines containing a filename plus a file test to try on it. (The
+ file test may also be a "cd", causing subsequent relative filenames
+ to be interpreted relative to that directory.) After the file test
+ you may put C<|| die> to make it a fatal error if the file test fails.
+ The default is C<|| warn>. The file test may optionally have a "!' prepended
+ to test for the opposite condition. If you do a cd and then list some
+ relative filenames, you may want to indent them slightly for readability.
+ If you supply your own die() or warn() message, you can use $file to
+ interpolate the filename.
+
+ Filetests may be bunched: "-rwx" tests for all of C<-r>, C<-w>, and C<-x>.
+ Only the first failed test of the bunch will produce a warning.
+
+ The routine returns the number of warnings issued.
+
+ =cut
+
@ISA = qw(Exporter);
@EXPORT = qw(validate);
Index: lib/File/Find.pm
*** perl5.001f/lib/File/Find.pm Tue Mar 7 11:34:41 1995
--- perl5.001g/lib/File/Find.pm Thu May 25 11:28:40 1995
***************
*** 5,10 ****
--- 5,65 ----
use Cwd;
use File::Basename;
+ =head1 NAME
+
+ find - traverse a file tree
+
+ finddepth - traverse a directory structure depth-first
+
+ =head1 SYNOPSIS
+
+ use File::Find;
+ find(\&wanted, '/foo','/bar');
+ sub wanted { ... }
+
+ use File::Find;
+ finddepth(\&wanted, '/foo','/bar');
+ sub wanted { ... }
+
+ =head1 DESCRIPTION
+
+ The wanted() function does whatever verifications you want. $dir contains
+ the current directory name, and $_ the current filename within that
+ directory. $name contains C<"$dir/$_">. You are chdir()'d to $dir when
+ the function is called. The function may set $prune to prune the tree.
+
+ This library is primarily for the C<find2perl> tool, which when fed,
+
+ find2perl / -name .nfs\* -mtime +7 \
+ -exec rm -f {} \; -o -fstype nfs -prune
+
+ produces something like:
+
+ sub wanted {
+ /^\.nfs.*$/ &&
+ (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
+ int(-M _) > 7 &&
+ unlink($_)
+ ||
+ ($nlink || (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_))) &&
+ $dev < 0 &&
+ ($prune = 1);
+ }
+
+ Set the variable $dont_use_nlink if you're using AFS, since AFS cheats.
+
+ C<finddepth> is just like C<find>, except that it does a depth-first
+ search.
+
+ Here's another interesting wanted function. It will find all symlinks
+ that don't resolve:
+
+ sub wanted {
+ -l && !-e && print "bogus link: $name\n";
+ }
+
+ =cut
+
@ISA = qw(Exporter);
@EXPORT = qw(find finddepth $name $dir);
Index: lib/FileHandle.pm
*** perl5.001f/lib/FileHandle.pm Tue Oct 18 12:34:50 1994
--- perl5.001g/lib/FileHandle.pm Thu May 25 11:18:20 1995
***************
*** 2,7 ****
--- 2,56 ----
# Note that some additional FileHandle methods are defined in POSIX.pm.
+ =head1 NAME
+
+ FileHandle - supply object methods for filehandles
+
+ cacheout - keep more files open than the system permits
+
+ =head1 SYNOPSIS
+
+ use FileHandle;
+ autoflush STDOUT 1;
+
+ cacheout($path);
+ print $path @data;
+
+ =head1 DESCRIPTION
+
+ See L<perlvar> for complete descriptions of each of the following supported C<FileHandle>
+ methods:
+
+ print
+ 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
+
+ The cacheout() function will make sure that there's a filehandle
+ open for writing available as the pathname you give it. It automatically
+ closes and re-opens files if you exceed your system file descriptor maximum.
+
+ =head1 BUGS
+
+ F<sys/param.h> lies with its C<NOFILE> define on some systems,
+ so you may have to set $cacheout::maxopen yourself.
+
+ Due to backwards compatibility, all filehandles resemble objects
+ of class C<FileHandle>, or actually classes derived from that class.
+ They actually aren't. Which means you can't derive your own
+ class from C<FileHandle> and inherit those methods.
+
+ =cut
+
require 5.000;
use English;
use Exporter;
Index: lib/Getopt/Long.pm
Prereq: 1.14
*** perl5.001f/lib/Getopt/Long.pm Wed Feb 8 19:11:39 1995
--- perl5.001g/lib/Getopt/Long.pm Thu May 25 11:55:14 1995
***************
*** 5,10 ****
--- 5,148 ----
@ISA = qw(Exporter);
@EXPORT = qw(GetOptions);
+ =head1 NAME
+
+ GetOptions - extended getopt processing
+
+ =head1 SYNOPSIS
+
+ use Getopt::Long;
+ $result = GetOptions (...option-descriptions...);
+
+ =head1 DESCRIPTION
+
+ The Getopt::Long module implements an extended getopt function called
+ GetOptions(). This function adheres to the new syntax (long option names,
+ no bundling). It tries to implement the better functionality of
+ traditional, GNU and POSIX getopt() functions.
+
+ Each description should designate a valid Perl identifier, optionally
+ followed by an argument specifier.
+
+ Values for argument specifiers are:
+
+ <none> option does not take an argument
+ ! option does not take an argument and may be negated
+ =s :s option takes a mandatory (=) or optional (:) string argument
+ =i :i option takes a mandatory (=) or optional (:) integer argument
+ =f :f option takes a mandatory (=) or optional (:) real number argument
+
+ If option "name" is set, it will cause the Perl variable $opt_name to
+ be set to the specified value. The calling program can use this
+ variable to detect whether the option has been set. Options that do
+ not take an argument will be set to 1 (one).
+
+ Options that take an optional argument will be defined, but set to ''
+ if no actual argument has been supplied.
+
+ If an "@" sign is appended to the argument specifier, the option is
+ treated as an array. Value(s) are not set, but pushed into array
+ @opt_name.
+
+ Options that do not take a value may have an "!" argument specifier to
+ indicate that they may be negated. E.g. "foo!" will allow B<-foo> (which
+ sets $opt_foo to 1) and B<-nofoo> (which will set $opt_foo to 0).
+
+ The option name may actually be a list of option names, separated by
+ '|'s, e.g. B<"foo|bar|blech=s". In this example, options 'bar' and
+ 'blech' will set $opt_foo instead.
+
+ Option names may be abbreviated to uniqueness, depending on
+ configuration variable $autoabbrev.
+
+ Dashes in option names are allowed (e.g. pcc-struct-return) and will
+ be translated to underscores in the corresponding Perl variable (e.g.
+ $opt_pcc_struct_return). Note that a lone dash "-" is considered an
+ option, corresponding Perl identifier is $opt_ .
+
+ A double dash "--" signals end of the options list.
+
+ If the first option of the list consists of non-alphanumeric
+ characters only, it is interpreted as a generic option starter.
+ Everything starting with one of the characters from the starter will
+ be considered an option.
+
+ The default values for the option starters are "-" (traditional), "--"
+ (POSIX) and "+" (GNU, being phased out).
+
+ Options that start with "--" may have an argument appended, separated
+ with an "=", e.g. "--foo=bar".
+
+ If configuration variable $getopt_compat is set to a non-zero value,
+ options that start with "+" may also include their arguments,
+ e.g. "+foo=bar".
+
+ A return status of 0 (false) indicates that the function detected
+ one or more errors.
+
+ =head1 EXAMPLES
+
+ If option "one:i" (i.e. takes an optional integer argument), then
+ the following situations are handled:
+
+ -one -two -> $opt_one = '', -two is next option
+ -one -2 -> $opt_one = -2
+
+ Also, assume "foo=s" and "bar:s" :
+
+ -bar -xxx -> $opt_bar = '', '-xxx' is next option
+ -foo -bar -> $opt_foo = '-bar'
+ -foo -- -> $opt_foo = '--'
+
+ In GNU or POSIX format, option names and values can be combined:
+
+ +foo=blech -> $opt_foo = 'blech'
+ --bar= -> $opt_bar = ''
+ --bar=-- -> $opt_bar = '--'
+
+ =over 12
+
+ =item $autoabbrev
+
+ Allow option names to be abbreviated to uniqueness.
+ Default is 1 unless environment variable
+ POSIXLY_CORRECT has been set.
+
+ =item $getopt_compat
+
+ Allow '+' to start options.
+ Default is 1 unless environment variable
+ POSIXLY_CORRECT has been set.
+
+ =item $option_start
+
+ Regexp with option starters.
+ Default is (--|-) if environment variable
+ POSIXLY_CORRECT has been set, (--|-|\+) otherwise.
+
+ =item $order
+
+ Whether non-options are allowed to be mixed with
+ options.
+ Default is $REQUIRE_ORDER if environment variable
+ POSIXLY_CORRECT has been set, $PERMUTE otherwise.
+
+ =item $ignorecase
+
+ Ignore case when matching options. Default is 1.
+
+ =item $debug
+
+ Enable debugging output. Default is 0.
+
+ =back
+
+ =head1 NOTE
+
+ Does not yet use the Exporter--or even packages!!
+ Thus, it's not a real module.
+
+ =cut
# newgetopt.pl -- new options parsing
***************
*** 316,322 ****
# Double dash is option list terminator.
if ( $opt eq $argend ) {
! unshift (@ret, @ARGV) if $order == $PERMUTE;
return ($error == 0);
}
elsif ( $opt =~ /^$genprefix/ ) {
--- 454,460 ----
# Double dash is option list terminator.
if ( $opt eq $argend ) {
! unshift (@ARGV, @ret) if $order == $PERMUTE;
return ($error == 0);
}
elsif ( $opt =~ /^$genprefix/ ) {
Index: lib/Getopt/Std.pm
*** perl5.001f/lib/Getopt/Std.pm Tue Oct 18 12:37:55 1994
--- perl5.001g/lib/Getopt/Std.pm Thu May 25 11:55:27 1995
***************
*** 2,7 ****
--- 2,31 ----
require 5.000;
require Exporter;
+ =head1 NAME
+
+ getopt - Process single-character switches with switch clustering
+
+ getopts - Process single-character switches with switch clustering
+
+ =head1 SYNOPSIS
+
+ use Getopt::Std;
+ getopt('oDI'); # -o, -D & -I take arg. Sets opt_* as a side effect.
+ getopts('oif:'); # -o & -i are boolean flags, -f takes an argument
+ # Sets opt_* as a side effect.
+
+ =head1 DESCRIPTION
+
+ The getopt() functions processes single-character switches with switch
+ clustering. Pass one argument which is a string containing all switches
+ that take an argument. For each switch found, sets $opt_x (where x is the
+ switch name) to the value of the argument, or 1 if no argument. Switches
+ which take an argument don't care whether there is a space between the
+ switch and the argument.
+
+ =cut
+
@ISA = qw(Exporter);
@EXPORT = qw(getopt getopts);
***************
*** 64,70 ****
($first,$rest) = ($1,$2);
$pos = index($argumentative,$first);
if($pos >= 0) {
! if($args[$pos+1] eq ':') {
shift(@ARGV);
if($rest eq '') {
++$errs unless @ARGV;
--- 88,94 ----
($first,$rest) = ($1,$2);
$pos = index($argumentative,$first);
if($pos >= 0) {
! if(defined($args[$pos+1]) and ($args[$pos+1] eq ':')) {
shift(@ARGV);
if($rest eq '') {
++$errs unless @ARGV;
Index: lib/I18N/Collate.pm
*** perl5.001f/lib/I18N/Collate.pm Tue Oct 18 12:37:58 1994
--- perl5.001g/lib/I18N/Collate.pm Thu May 25 11:30:29 1995
***************
*** 1,5 ****
--- 1,39 ----
package I18N::Collate;
+ =head1 NAME
+
+ Collate - compare 8-bit scalar data according to the current locale
+
+ =head1 SYNOPSIS
+
+ use Collate;
+ setlocale(LC_COLLATE, 'locale-of-your-choice');
+ $s1 = new Collate "scalar_data_1";
+ $s2 = new Collate "scalar_data_2";
+
+ =head1 DESCRIPTION
+
+ This module provides you with objects that will collate
+ according to your national character set, providing the
+ POSIX setlocale() function should be supported on your system.
+
+ You can compare $s1 and $s2 above with
+
+ $s1 le $s2
+
+ to extract the data itself, you'll need a dereference: $$s1
+
+ This uses POSIX::setlocale The basic collation conversion is done by
+ strxfrm() which terminates at NUL characters being a decent C routine.
+ collate_xfrm() handles embedded NUL characters gracefully. Due to C<cmp>
+ and overload magic, C<lt>, C<le>, C<eq>, C<ge>, and C<gt> work also. The
+ available locales depend on your operating system; try whether C<locale
+ -a> shows them or the more direct approach C<ls /usr/lib/nls/loc> or C<ls
+ /usr/lib/nls>. The locale names are probably something like
+ "xx_XX.(ISO)?8859-N".
+
+ =cut
+
# Collate.pm
#
# Author: Jarkko Hietaniemi <Jarkko.Hietaniemi@hut.fi>
Index: lib/IPC/Open2.pm
*** perl5.001f/lib/IPC/Open2.pm Tue Oct 18 12:38:01 1994
--- perl5.001g/lib/IPC/Open2.pm Thu May 25 11:31:07 1995
***************
*** 3,8 ****
--- 3,53 ----
require Exporter;
use Carp;
+ =head1 NAME
+
+ IPC::Open2, open2 - open a process for both reading and writing
+
+ =head1 SYNOPSIS
+
+ use IPC::Open2;
+ $pid = open2('rdr', 'wtr', 'some cmd and args');
+ # or
+ $pid = open2('rdr', 'wtr', 'some', 'cmd', 'and', 'args');
+
+ =head1 DESCRIPTION
+
+ The open2() function spawns the given $cmd and connects $rdr for
+ reading and $wtr for writing. It's what you think should work
+ when you try
+
+ open(HANDLE, "|cmd args");
+
+ open2() returns the process ID of the child process. It doesn't return on
+ failure: it just raises an exception matching C</^open2:/>.
+
+ =head1 WARNING
+
+ It will not create these file handles for you. You have to do this yourself.
+ So don't pass it empty variables expecting them to get filled in for you.
+
+ Additionally, this is very dangerous as you may block forever.
+ It assumes it's going to talk to something like B<bc>, both writing to
+ it and reading from it. This is presumably safe because you "know"
+ that commands like B<bc> will read a line at a time and output a line at
+ a time. Programs like B<sort> that read their entire input stream first,
+ however, are quite apt to cause deadlock.
+
+ The big problem with this approach is that if you don't have control
+ over source code being run in the the child process, you can't control what it does
+ with pipe buffering. Thus you can't just open a pipe to "cat -v" and continually
+ read and write a line from it.
+
+ =head1 SEE ALSO
+
+ See L<open3> for an alternative that handles STDERR as well.
+
+ =cut
+
@ISA = qw(Exporter);
@EXPORT = qw(open2);
Index: lib/IPC/Open3.pm
Prereq: 1.1
*** perl5.001f/lib/IPC/Open3.pm Tue Oct 18 12:38:04 1994
--- perl5.001g/lib/IPC/Open3.pm Thu May 25 11:31:25 1995
***************
*** 3,8 ****
--- 3,33 ----
require Exporter;
use Carp;
+ =head1 NAME
+
+ IPC::Open3, open3 - open a process for reading, writing, and error handling
+
+ =head1 SYNOPSIS
+
+ $pid = open3('WTRFH', 'RDRFH', 'ERRFH'
+ 'some cmd and args', 'optarg', ...);
+
+ =head1 DESCRIPTION
+
+ Extremely similar to open2(), open3() spawns the given $cmd and
+ connects RDRFH for reading, WTRFH for writing, and ERRFH for errors. If
+ ERRFH is '', or the same as RDRFH, then STDOUT and STDERR of the child are
+ on the same file handle.
+
+ If WTRFH begins with ">&", then WTRFH will be closed in the parent, and
+ the child will read from it directly. if RDRFH or ERRFH begins with
+ ">&", then the child will send output directly to that file handle. In both
+ cases, there will be a dup(2) instead of a pipe(2) made.
+
+ All caveats from open2() continue to apply. See L<open2> for details.
+
+ =cut
+
@ISA = qw(Exporter);
@EXPORT = qw(open3);
Index: lib/Net/Ping.pm
*** perl5.001f/lib/Net/Ping.pm Tue Oct 18 12:38:18 1994
--- perl5.001g/lib/Net/Ping.pm Thu May 25 11:33:14 1995
***************
*** 1,5 ****
--- 1,44 ----
package Net::Ping;
+ =head1 NAME
+
+ Net::Ping, pingecho - check a host for upness
+
+ =head1 SYNOPSIS
+
+ use Net::Ping;
+ print "'jimmy' is alive and kicking\n" if pingecho('jimmy', 10) ;
+
+ =head1 DESCRIPTION
+
+ This module contains routines to test for the reachability of remote hosts.
+ Currently the only routine implemented is pingecho().
+
+ pingecho() uses a TCP echo (I<not> an ICMP one) to determine if the
+ remote host is reachable. This is usually adequate to tell that a remote
+ host is available to rsh(1), ftp(1), or telnet(1) onto.
+
+ =head2 Parameters
+
+ =over 5
+
+ =item hostname
+
+ The remote host to check, specified either as a hostname or as an IP address.
+
+ =item timeout
+
+ The timeout in seconds. If not specified it will default to 5 seconds.
+
+ =back
+
+ =head1 WARNING
+
+ pingecho() uses alarm to implement the timeout, so don't set another alarm
+ while you are using it.
+
+ =cut
+
# Authors: karrer@bernina.ethz.ch (Andreas Karrer)
# pmarquess@bfsec.bt.co.uk (Paul Marquess)
Index: lib/Term/Complete.pm
*** perl5.001f/lib/Term/Complete.pm Tue Oct 18 12:38:32 1994
--- perl5.001g/lib/Term/Complete.pm Wed May 24 12:09:48 1995
***************
*** 37,43 ****
$erase2 = "\010";
}
! sub complete {
$prompt = shift;
if (ref $_[0] || $_[0] =~ /^\*/) {
@cmp_lst = sort @{$_[0]};
--- 37,43 ----
$erase2 = "\010";
}
! sub Complete {
$prompt = shift;
if (ref $_[0] || $_[0] =~ /^\*/) {
@cmp_lst = sort @{$_[0]};
Index: lib/Text/Abbrev.pm
*** perl5.001f/lib/Text/Abbrev.pm Tue Oct 18 12:38:38 1994
--- perl5.001g/lib/Text/Abbrev.pm Thu May 25 11:34:02 1995
***************
*** 2,7 ****
--- 2,29 ----
require 5.000;
require Exporter;
+ =head1 NAME
+
+ abbrev - create an abbreviation table from a list
+
+ =head1 SYNOPSIS
+
+ use Abbrev;
+ abbrev *HASH, LIST
+
+
+ =head1 DESCRIPTION
+
+ Stores all unambiguous truncations of each element of LIST
+ as keys key in the associative array indicated by C<*hash>.
+ The values are the original list elements.
+
+ =head1 EXAMPLE
+
+ abbrev(*hash,qw("list edit send abort gripe"));
+
+ =cut
+
@ISA = qw(Exporter);
@EXPORT = qw(abbrev);
Index: lib/Text/Tabs.pm
*** perl5.001f/lib/Text/Tabs.pm Wed Feb 8 19:11:42 1995
--- perl5.001g/lib/Text/Tabs.pm Wed May 24 14:29:04 1995
***************
*** 2,11 ****
# expand and unexpand tabs as per the unix expand and
# unexpand programs.
#
! # expand and unexpand operate on arrays of lines. Do not
! # feed strings that contain newlines to them.
#
# David Muir Sharnoff <muir@idiom.com>
#
package Text::Tabs;
--- 2,11 ----
# expand and unexpand tabs as per the unix expand and
# unexpand programs.
#
! # expand and unexpand operate on arrays of lines.
#
# David Muir Sharnoff <muir@idiom.com>
+ # Version: 4/19/95
#
package Text::Tabs;
***************
*** 19,47 ****
sub expand
{
! my @l = @_;
! for $_ (@l) {
! 1 while s/^([^\t]*)(\t+)/
! $1 . (" " x
! ($tabstop * length($2)
! - (length($1) % $tabstop)))
! /e;
}
! return @l;
}
sub unexpand
{
! my @l = &expand(@_);
my @e;
! for $x (@l) {
! @e = split(/(.{$tabstop})/,$x);
! for $_ (@e) {
! s/ +$/\t/;
}
! $x = join('',@e);
}
! return @l;
}
1;
--- 19,63 ----
sub expand
{
! my (@l) = @_;
! my $l, @k;
! my $nl;
! for $l (@l) {
! $nl = $/ if chomp($l);
! @k = split($/,$l);
! for $_ (@k) {
! 1 while s/^([^\t]*)(\t+)/
! $1 . (" " x
! ($tabstop * length($2)
! - (length($1) % $tabstop)))
! /e;
! }
! $l = join("\n",@k).$nl;
}
! return @l if $#l > 0;
! return $l[0];
}
sub unexpand
{
! my (@l) = &expand(@_);
my @e;
! my $k, @k;
! my $nl;
! for $k (@l) {
! $nl = $/ if chomp($k);
! @k = split($/,$k);
! for $x (@k) {
! @e = split(/(.{$tabstop})/,$x);
! for $_ (@e) {
! s/ +$/\t/;
! }
! $x = join('',@e);
}
! $k = join("\n",@k).$nl;
}
! return @l if $#l > 0;
! return $l[0];
}
1;
Index: lib/integer.pm
*** perl5.001f/lib/integer.pm Tue Oct 18 12:36:34 1994
--- perl5.001g/lib/integer.pm Thu May 25 11:19:41 1995
***************
*** 1,5 ****
--- 1,26 ----
package integer;
+ =head1 NAME
+
+ integer - Perl pragma to compute arithmetic in integer instead of double
+
+ =head1 SYNOPSIS
+
+ use integer;
+ $x = 10/3;
+ # $x is now 3, not 3.33333333333333333
+
+ =head1 DESCRIPTION
+
+ This tells the compiler that it's okay to use integer operations
+ from here to the end of the enclosing BLOCK. On many machines,
+ this doesn't matter a great deal for most computations, but on those
+ without floating point hardware, it can make a big difference.
+
+ See L<perlmod/Pragmatic Modules>.
+
+ =cut
+
sub import {
$^H |= 1;
}
Index: lib/less.pm
*** perl5.001f/lib/less.pm Tue Oct 18 12:36:36 1994
--- perl5.001g/lib/less.pm Thu May 25 11:19:59 1995
***************
*** 1,2 ****
--- 1,19 ----
package less;
+
+ =head1 NAME
+
+ less - Perl pragma to request less of something from the compiler
+
+ =head1 DESCRIPTION
+
+ Currently unimplemented, this may someday be a compiler directive
+ to make certain trade-offs, such as perhaps
+
+ use less 'memory';
+ use less 'CPU';
+ use less 'fat';
+
+
+ =cut
+
1;
Index: lib/sigtrap.pm
*** perl5.001f/lib/sigtrap.pm Tue Oct 18 12:36:58 1994
--- perl5.001g/lib/sigtrap.pm Thu May 25 11:20:13 1995
***************
*** 1,5 ****
--- 1,27 ----
package sigtrap;
+ =head1 NAME
+
+ sigtrap - Perl pragma to enable stack backtrace on unexpected signals
+
+ =head1 SYNOPSIS
+
+ use sigtrap;
+ use sigtrap qw(BUS SEGV PIPE SYS ABRT TRAP);
+
+ =head1 DESCRIPTION
+
+ The C<sigtrap> pragma initializes some default signal handlers that print
+ a stack dump of your Perl program, then sends itself a SIGABRT. This
+ provides a nice starting point if something horrible goes wrong.
+
+ By default, handlers are installed for the ABRT, BUS, EMT, FPE, ILL, PIPE,
+ QUIT, SEGV, SYS, TERM, and TRAP signals.
+
+ See L<perlmod/Pragmatic Modules>.
+
+ =cut
+
require Carp;
sub import {
Index: lib/strict.pm
*** perl5.001f/lib/strict.pm Tue Oct 18 12:37:06 1994
--- perl5.001g/lib/strict.pm Thu May 25 11:20:27 1995
***************
*** 1,5 ****
--- 1,73 ----
package strict;
+ =head1 NAME
+
+ strict - Perl pragma to restrict unsafe constructs
+
+ =head1 SYNOPSIS
+
+ use strict;
+
+ use strict "vars";
+ use strict "refs";
+ use strict "subs";
+
+ use strict;
+ no strict "vars";
+
+ =head1 DESCRIPTION
+
+ If no import list is supplied, all possible restrictions are assumed.
+ (This is the safest mode to operate in, but is sometimes too strict for
+ casual programming.) Currently, there are three possible things to be
+ strict about: "subs", "vars", and "refs".
+
+ =over 6
+
+ =item C<strict refs>
+
+ This generates a runtime error if you
+ use symbolic references (see L<perlref>).
+
+ use strict 'refs';
+ $ref = \$foo;
+ print $$ref; # ok
+ $ref = "foo";
+ print $$ref; # runtime error; normally ok
+
+ =item C<strict vars>
+
+ This generates a compile-time error if you access a variable that wasn't
+ localized via C<my()> or wasn't fully qualified. Because this is to avoid
+ variable suicide problems and subtle dynamic scoping issues, a merely
+ local() variable isn't good enough. See L<perlfunc/my> and
+ L<perlfunc/local>.
+
+ use strict 'vars';
+ $X::foo = 1; # ok, fully qualified
+ my $foo = 10; # ok, my() var
+ local $foo = 9; # blows up
+
+ The local() generated a compile-time error because you just touched a global
+ name without fully qualifying it.
+
+ =item C<strict subs>
+
+ This disables the poetry optimization,
+ generating a compile-time error if you
+ try to use a bareword identifier that's not a subroutine.
+
+ use strict 'subs';
+ $SIG{PIPE} = Plumber; # blows up
+ $SIG{"PIPE"} = "Plumber"; # just fine
+
+ =back
+
+ See L<perlmod/Pragmatic Modules>.
+
+
+ =cut
+
sub bits {
my $bits = 0;
foreach $sememe (@_) {
Index: lib/subs.pm
*** perl5.001f/lib/subs.pm Tue Oct 18 12:37:09 1994
--- perl5.001g/lib/subs.pm Thu May 25 11:20:45 1995
***************
*** 1,5 ****
--- 1,23 ----
package subs;
+ =head1 NAME
+
+ subs - Perl pragma to predeclare sub names
+
+ =head1 SYNOPSIS
+
+ use subs qw(frob);
+ frob 3..10;
+
+ =head1 DESCRIPTION
+
+ This will predeclare all the subroutine whose names are
+ in the list, allowing you to use them without parentheses
+ even before they're declared.
+
+ See L<perlmod/Pragmatic Modules> and L<strict/subs>.
+
+ =cut
require 5.000;
$ExportLevel = 0;
End of patch.