Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!ucbvax!iwarp.intel.com!news From: merlyn@iwarp.intel.com (Randal Schwartz) Newsgroups: comp.lang.perl Subject: Re: Novice Question, Successive Lines Keywords: Novice Question, Successive Lines Message-ID: <1990Mar21.165059.13281@iwarp.intel.com> Date: 21 Mar 90 16:50:59 GMT References: <13447@cgl.ucsf.EDU> Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) Distribution: na Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 12 In-Reply-To: alonso@maxwell.mmwb.ucsf.edu (Darwin Alonso) In article <13447@cgl.ucsf.EDU>, alonso@maxwell (Darwin Alonso) writes: | How would one get perl to replace two or more successive blank lines | with one blank line? perl -ne 'print if /./ || !$s; $s = /^$/;' print "Just another Perl hacker,"; -- /=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: "Welcome to Portland, Oregon, home of the California Raisins!"=/