Article 12311 of comp.lang.perl:
Path: feenix.metronet.com!news.ecn.bgu.edu!usenet.ins.cwru.edu!howland.reston.ans.net!cs.utexas.edu!uunet!meaddata!petew
From:
[email protected] (Pete Williams)
Newsgroups: comp.lang.perl
Subject: Re: New hex dump utility with auto EBC<=>ASC conversion
Date: 5 Apr 1994 23:57:10 GMT
Organization: Mead Data Central, Dayton OH
Lines: 115
Message-ID: <
[email protected]>
References: <
[email protected]>
NNTP-Posting-Host: fracture.meaddata.com
As an added bonus, I've added a little something that calls the
ASCII<->EBCDIC module. Basically, this is a hex dump in a (I think)
more readable format, with the added bonus that it automatically
determines (with some margin of error, no doubt) whether a file
is in ASCII or EBCDIC format; if it is in EBCDIC format, the
ASCII representations of the characters are printed out instead.
There are a few other bells and whistles as well.
While I'm not entirely happy with the coding, it seems to work well.
I've noted known bugs on the attached (wrapman-ned) manual page.
Any suggestions, especially on testing an input file format (EBCDIC
or ASCII) would be greatly appreciated.
As usual, bugs, hacks, suggestions, etc, to me. Naturally, I offer no
warranties of any kind; any similarities to programs living or dead are
entirely coincidental (except of course, the "heart" of the routine --
thanks Larry/Randal!). All mistakes entirely my own.
Thanks again to everyone who responded to my post. Hope someone finds this
useful.
Pete
_/_/_/_/_/_/ _/_/_/_/_/_/_/_/_/_/_/_/ _/ "'Tis an ill wind that
_/ _/ _/ _/ _/ _/ blows no minds"
_/_/_/_/ _/_/_/ _/ _/_/_/_/_/_/_/_/_/ --Malaclypse the Younger
_/ _/ _/ _/ _/
_/ _/_/_/_/ _/ _/_/_/_/ _/ ==
[email protected] ==
-------%x-------------------CUT-HERE-------------------%x-------
begin 640 nhd.gz
M'XL("%'NH2T VYH9 "U6FU3VT@2_LS\BEGBQ/9ARR^0S28<&P@X"74)4)AL
MZBJPJ;$TMK7(DD\:0;C=S6^_IWM&LHS))K5'M%MX-"_=TR_S=/<H#WZ0G3Q+
M.U'BJZ@S"N/.7*>1J =A?5O4PTFWB]\'XH&LO=8JT&G-OKQ))FC=XP.B1Z\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\4T:/2:MH ]W'MU
M=#P\.]P?(JO@?T2065Y;'@XFJ6(:3N#O//O%NU=#,=2F]-/E/*&!$MJY:]/9
MQ&6^ROK((JV3 I.C<O),W:#PA,YDQ638"M(MMGP,(1&>%'\-;MG$9JK%,GML
M'\6;"VL55M<4N%UVL_APG-GPONR42>SN3:P1273X1':#7',&L(.S!3 U-I L
M.92@_5.L-72#,H_HFSA.8B$))-B3601BAOP[Y(__\)@J;U%4^$2*,US*9^#2
M' G#F2Z^P(QS R@J*O&08"0^KQN+)D 1^A<P-YSM0)2;ZK\ND(W0TUZK8I//
>B#V<&9)#B9?A)W+>^ :N^EQX^I/X'X&*HJI@(P
end
-------%x-------------------CUT-HERE-------------------%x-------
From
[email protected] Mon Apr 11 01:15:46 CDT 1994
Article: 12392 of comp.lang.perl
Path: feenix.metronet.com!news.utdallas.edu!chpc.utexas.edu!cs.utexas.edu!uunet!meaddata!petew
From:
[email protected] (Pete Williams)
Newsgroups: comp.lang.perl
Subject: Patch for hexdump
Date: 7 Apr 1994 20:53:12 GMT
Organization: Mead Data Central, Dayton OH
Lines: 36
Message-ID: <
[email protected]>
References: <
[email protected]>
NNTP-Posting-Host: fracture.meaddata.com
My apologies again --
I put in an old copy of "nhd" on a previous post... Here is the patch
to get it working right.
To apply:
1. Save patch to a separate file, say "patch00";
2. "patch nhd < patch00"
Pete
------------------------------CUT HERE---------------------------------------
7c7
< # Usage: nhd [-lnnn] [-rnnn] [-pnnn] -a -e [file]
---
> # Usage: nhd [-lnnn] [-rnnn] -a -e [file]
20d19
< ($arg =~ /-p(\d+)/) && ($= = $1) && next;
43,46d41
< # Check to see if file is in EBCDIC format on first go-round...
<
< ($ebcdic,$ctr) = &EbcTest unless ($transflag || $ctr);
<
49a45,48
>
> # Check to see if file is in EBCDIC format on first go-round...
> ($ebcdic,$ctr) = &EbcTest unless ($transflag || $ctr);
>
271,275d269
< .TP
< .B -pnnn
< Page length. Page size is set to nnn. This allows for "manual" adjusting of
< page size so that output will fit on a terminal screen or a printer with
< a given font. Default is 60.
------------------------------CUT HERE---------------------------------------