X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fabbrev.pl;h=c505a6f28bd7bb79152fd90fc57fd0e6cbf83f0c;hb=29c2e10b646568439f261863b569e814d4538b73;hp=c233d4af7e63adc4e2ac9e07314ce8ba74fb5a96;hpb=449aadcac0f13893f2b716ea169bf74293ee9c41;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/abbrev.pl b/lib/abbrev.pl index c233d4a..c505a6f 100644 --- a/lib/abbrev.pl +++ b/lib/abbrev.pl @@ -4,6 +4,16 @@ ;# ... ;# $long = $foo{$short}; +# +# This library is no longer being maintained, and is included for backward +# compatibility with Perl 4 programs which may require it. +# +# In particular, this should not be used as an example of modern Perl +# programming techniques. +# +# Suggested alternative: Text::Abbrev +# + package abbrev; sub main'abbrev { @@ -17,7 +27,7 @@ sub main'abbrev { $len = 1; foreach $cmp (@cmp) { next if $cmp eq $name; - while (substr($cmp,0,$len) eq $abbrev) { + while (@extra && substr($cmp,0,$len) eq $abbrev) { $abbrev .= shift(@extra); ++$len; }