Path: utzoo!attcan!uunet!decwrl!ucbvax!iwarp.intel.com!news From: merlyn@iwarp.intel.com (Randal Schwartz) Newsgroups: comp.lang.perl Subject: Re: Deleting (Only) First Blank Line in File Message-ID: <1990Jul1.225510.24380@iwarp.intel.com> Date: 1 Jul 90 22:55:10 GMT References: <1651@fallst.UUCP> <1990Jun30.214249.15211@iwarp.intel.com> Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) Distribution: comp Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 18 In-Reply-To: emv@math.lsa.umich.edu (Edward Vielmetti) In article , emv@math (Edward Vielmetti) writes: | hm, nice. how about this problem: printing the first 10 lines after | a signal line? Ambiguous spec. I'm presuming you mean "eleven total lines, including the trigger line", since your code seems to want to do that. perl -ne 'print if /===/ ? ($c = 11) : (--$c > 0)' ($c if positive is the number of lines left to be printed, including the current one.) $x=25;print substr(',rekcah lreP rehtona tsuJ',$x,1) while --$x >= 0 -- /=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!"=/