Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!ccu.umanitoba.ca!herald.usask.ca!alberta!brazeau.ucs.ualberta.ca!unixg.ubc.ca!ubc-cs!uw-beaver!zephyr.ens.tek.com!uunet!cis.ohio-state.edu!ucbvax!CAS.BITNET!lwv27 From: lwv27@CAS.BITNET (Larry W. Virden ext. 2487) Newsgroups: comp.lang.perl Subject: Perl Pretty printer? Message-ID: <9106281456.AA3479@cas.org> Date: 28 Jun 91 18:56:25 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 15 Anyone have a perl pretty printer? Someone recently posted the following, and before I try to figure out where the missing newline is, I wanted to reformat it... #! /cas/tools/pdbin/sun4/perl while(<>){chop;if($_ eq"%"){$t="";}elsif($t eq""){$t=$_;}else{$e{$t}.="$_\n";} }srand;$_="CODE";while($_){s/^\W*//;print$&;if(s/^\w+//){if($e{$&}){split(/\n/, $e{$&}); $_=$_[rand(1+$#_)].$_;}else{print$&;}}} print -- Larry W. Virden UUCP: osu-cis!chemabs!lwv27 Same Mbox: BITNET: lwv27@cas INET: lwv27%cas.BITNET@CUNYVM.CUNY.Edu Personal: 674 Falls Place, Reynoldsburg,OH 43068-1614 America Online: lvirden