#!/usr/bin/perl -w

use strict;
use Ascii
     qw/ NUL SOH STX ETX EOT ENQ ACK BEL
     BS  HT  LF  VT  FF  CR  SO  SI
     DLE DC1 DC2 DC3 DC4 NAK SYN ETB
     CAN EM  SUB ESC FS  GS  RS  US
     DEL CTRL @val @NAME @name /;

print 'Numeric values of @val in hex:' . "\n";
for (my $ix = 0; $ix < @val; $ix++ ) {
    if ($ix && $ix % 4 == 0) {
	print "\n";
    }
    printf(" %3s = 0x%02x,", $NAME[$ix], ord $val[$ix]);
}
print "\n";
print "\n";

printf("%s", "CTRL(M) and CTRL(J):<" . CTRL('M') . CTRL('J') . ">\n");
print "\n";

########################################
print 'Names in @NAME:' . "\n";
printf "        " . "%3s "x16 . "\n", @NAME[ 0..15];
printf "        " . "%3s "x16 . "\n", @NAME[16..31];
printf "        " . "%3s "    . "\n", $NAME[32    ];
print 'Names in @name:' . "\n";
printf "        " . "%3s "x16 . "\n", @name[ 0..15];
printf "        " . "%3s "x16 . "\n", @name[16..31];
printf "        " . "%3s "    . "\n", $name[32    ];

print 'The output of @val piped through od:' . "\n";
open(FH, "| od -a");
print FH @val;

__END__
