Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!ucsd!ucbvax!iwarp.intel.com!news From: merlyn@iwarp.intel.com (Randal L. Schwartz) Newsgroups: comp.lang.perl Subject: Re: wc clone Message-ID: <1990Dec21.162623.23603@iwarp.intel.com> Date: 21 Dec 90 16:26:23 GMT References: <1990Dec20.003805.8017@convex.com> <1990Dec20.020632.10077@convex.com> <1990Dec20.193625.662@convex.com> <1990Dec21.110952.27897@convex.com> Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal L. Schwartz) Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 19 In-Reply-To: tchrist@convex.COM (Tom Christiansen) In article <1990Dec21.110952.27897@convex.com>, tchrist@convex (Tom Christiansen) writes: | 3 $tlines += $.; $twords += $words; $tchars += $chars;reset 'wc'; $. = 0; I don't like the 'wc' in there. Here's a weirder way, that actually says what you are doing more clearly: ($tlines, $twords, $tchars, $., $words, $chars) = ($tlines + $., $twords + $words, $tchars + $chars, 0, 0, 0); (With short enough variable names, this fits on one line easily.) @a[3,2,1,0] = ("hacker,","Perl","another","Just"); print "@a" -- /=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\ | on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III | | merlyn@iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn | \=Cute Quote: "Intel: putting the 'backward' in 'backward compatible'..."====/