patch for lib/Term/Cap.pm for EBCDIC platform Hi,

Here is the patch below. Any question, pls let me know, thanks.

--- /home/spring/perl/perl-current/lib/Term/Cap.pm      2006-06-14 
03:29:18.000000000 +0800
+++ /home/spring/patch/chgfile/lib-Term-Cap.pm  2007-09-10 
14:08:42.000000000 +0800
@@ -339,18 +339,34 @@
            # print STDERR "DEBUG: string $1 = $2\\n";
            next if defined $self->{'_' . ($cap = $1)};
            $_ = $2;
-           s/\\\\E/\\033/g;
-           s/\\\\(\\d\\d\\d)/pack('c',oct($1) & 0177)/eg;
-           s/\\\\n/\\n/g;
-           s/\\\\r/\\r/g;
-           s/\\\\t/\\t/g;
-           s/\\\\b/\\b/g;
-           s/\\\\f/\\f/g;
-           s/\\\\\\^/\\377/g;
-           s/\\^\\?/\\177/g;
-           s/\\^(.)/pack('c',ord($1) & 31)/eg;
-           s/\\\\(.)/$1/g;
-           s/\\377/^/g;
+      if (ord("A") == 193) {
+               s/\\\\E/\\047/g;
+               s/\\\\(\\d\\d\\d)/pack('c',oct($1) & 0177)/eg;
+               s/\\\\n/\\n/g;
+               s/\\\\r/\\r/g;
+               s/\\\\t/\\t/g;
+               s/\\\\b/\\b/g;
+               s/\\\\f/\\f/g;
+               s/\\\\\\^/\\337/g;
+               s/\\^\\?/\\007/g;
+               s/\\^(.)/pack('c',ord($1) & 31)/eg;
+               s/\\\\(.)/$1/g;
+               s/\\337/^/g;
+      }
+      else {
+               s/\\\\E/\\033/g;
+               s/\\\\(\\d\\d\\d)/pack('c',oct($1) & 0177)/eg;
+               s/\\\\n/\\n/g;
+               s/\\\\r/\\r/g;
+               s/\\\\t/\\t/g;
+               s/\\\\b/\\b/g;
+               s/\\\\f/\\f/g;
+               s/\\\\\\^/\\377/g;
+               s/\\^\\?/\\177/g;
+               s/\\^(.)/pack('c',ord($1) & 31)/eg;
+               s/\\\\(.)/$1/g;
+               s/\\377/^/g;
+      }
            $self->{'_' . $cap} = $_;
        }
        # else { carp "junk in $term ignored: $field"; }




Ge, Chun Bing
ç©ºå±±æ°é¨åï¼å¤©æ°ææ¥ç§
