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: petew@meaddata.com (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: <2nstsm$c1e@meaddata.meaddata.com> References: <2nstl1$brl@meaddata.meaddata.com> 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 _/ _/ _/ _/ _/ _/ _/_/_/_/ _/ _/_/_/_/ _/ == petew@meaddata.com == -------%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=/1J =A?5O4PTFWB]\'XH&LO=8JT&G-OKQ))FC=XP.B1Z\/ MF/B[3$WT,QE/ _FA'<5Q?('?E'_;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3FR0-5?20OXFUTZVM+E\W(0_G\4HV<9WD4<"1[LS++L*)>\YXNF(H6/J3N"ZYLTU)FM@2;T 8^"WS?&WZ(<)=AB$)C3 M]U4;L0+Z\@3D2])+SO:)+(81\XNLE,)6"Z&CT^;_]L25#HS-QA'(@O@K3)*9/Y/)* >9&D2OC%TM>'KX9##&9]8SWO7=G MKX]/Q0GL)=]C(Z&:%55?G 0LS!N5IC?R/5W5%V&/+P+@A"CDM]M-:.-%/LE: M@K\+Y),) )4EP^(Y"%_OSK0*Z*K#@Q(MW_7A8"#WW@R/U\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%'\-;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^AB#V<&9)#B9?A)W+>^ :N^EQX^I/X'X&*HJI@(P end -------%x-------------------CUT-HERE-------------------%x------- From petew@meaddata.com 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: petew@meaddata.com (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: <2o1rro$b8p@meaddata.meaddata.com> References: <2nstl1$brl@meaddata.meaddata.com> 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--------------------------------------- .