summaryrefslogtreecommitdiff
path: root/lib/Text
diff options
context:
space:
mode:
authorAndy Dougherty <doughera@lafcol.lafayette.edu>1995-05-30 01:56:48 +0000
committerAndy Dougherty <doughera@lafcol.lafayette.edu>1995-05-30 01:56:48 +0000
commitf06db76b9e41859439aeadb79feb6c603ee741ff (patch)
tree0898eb19feb17c3aa0ff6916fc182a998f1b9949 /lib/Text
parentd1b918924020f633640d8b8cc8294856a82ddc04 (diff)
downloadperl-f06db76b9e41859439aeadb79feb6c603ee741ff.tar.gz
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.
Diffstat (limited to 'lib/Text')
-rw-r--r--lib/Text/Abbrev.pm22
-rw-r--r--lib/Text/Tabs.pm50
2 files changed, 55 insertions, 17 deletions
diff --git a/lib/Text/Abbrev.pm b/lib/Text/Abbrev.pm
index 77370d37c3..d12dfb36a6 100644
--- a/lib/Text/Abbrev.pm
+++ b/lib/Text/Abbrev.pm
@@ -2,6 +2,28 @@ package Text::Abbrev;
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);
diff --git a/lib/Text/Tabs.pm b/lib/Text/Tabs.pm
index c90d1aa672..fa866988cf 100644
--- a/lib/Text/Tabs.pm
+++ b/lib/Text/Tabs.pm
@@ -2,10 +2,10 @@
# 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.
+# expand and unexpand operate on arrays of lines.
#
# David Muir Sharnoff <muir@idiom.com>
+# Version: 4/19/95
#
package Text::Tabs;
@@ -19,29 +19,45 @@ $tabstop = 8;
sub expand
{
- my @l = @_;
- for $_ (@l) {
- 1 while s/^([^\t]*)(\t+)/
- $1 . (" " x
- ($tabstop * length($2)
- - (length($1) % $tabstop)))
- /e;
+ 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;
+ return @l if $#l > 0;
+ return $l[0];
}
sub unexpand
{
- my @l = &expand(@_);
+ my (@l) = &expand(@_);
my @e;
- for $x (@l) {
- @e = split(/(.{$tabstop})/,$x);
- for $_ (@e) {
- s/ +$/\t/;
+ 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);
}
- $x = join('',@e);
+ $k = join("\n",@k).$nl;
}
- return @l;
+ return @l if $#l > 0;
+ return $l[0];
}
1;