X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Ftermcap.pl;h=f295a2d476b53b9b360abe329f4c5448d04a2434;hb=8d481ee5bb3b5edbc9e7e7ba50aa3437fea792a6;hp=e8f108df0671837efab59cc55df3aa6cc3044db6;hpb=a0d0e21ea6ea90a22318550944fe6cb09ae10cda;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/termcap.pl b/lib/termcap.pl index e8f108d..f295a2d 100644 --- a/lib/termcap.pl +++ b/lib/termcap.pl @@ -1,4 +1,13 @@ ;# $RCSfile: termcap.pl,v $$Revision: 4.1 $$Date: 92/08/07 18:24:16 $ +# +# 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: Term::Cap +# ;# ;# Usage: ;# require 'ioctl.pl'; @@ -13,8 +22,8 @@ sub Tgetent { local($TERM) = @_; local($TERMCAP,$_,$entry,$loop,$field); - warn "Tgetent: no ospeed set" unless $ospeed; - foreach $key (keys(TC)) { + # warn "Tgetent: no ospeed set" unless $ospeed; + foreach $key (keys %TC) { delete $TC{$key}; } $TERM = $ENV{'TERM'} unless $TERM; @@ -63,6 +72,9 @@ sub Tgetent { $entry = $1; $_ = $2; s/\\E/\033/g; + s/\\(200)/pack('c',0)/eg; # NUL character + s/\\(0\d\d)/pack('c',oct($1))/eg; # octal + s/\\(0x[0-9A-Fa-f][0-9A-Fa-f])/pack('c',hex($1))/eg; # hex s/\\(\d\d\d)/pack('c',$1 & 0177)/eg; s/\\n/\n/g; s/\\r/\r/g;