Re: extracting line between words

2006-09-14 Thread John W. Krahn
John W. Krahn wrote: > [EMAIL PROTECTED] wrote: >> >>But the output is coming like this TheSunrisesintheeast >> >>But I want the output like this The Sun rises in the east > > my @line = "The Sun rises in > the east and "; > print join ' ', split ' ', $line[ 0 ]; print map { join(

Re: extracting line between words

2006-09-14 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > Hi Perlers... Hello, > I need to extract line between two words > > like > > > @line = "The Sun rises in > the east and "; > > Now I want to extract the line from The word to east > > For tht I am using the following code: > > #!

RE: extracting line between words

2006-09-14 Thread Nagasamudram, Prasanna Kumar
ile(<@line>){ print if $_ =~ /The/ .. /east/ ; } print "\n"; Thanks Prasannna -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, September 14, 2006 4:57 PM To: beginners@perl.org Subject: extracting line between words Hi Perlers

Re: extracting line between words

2006-09-14 Thread Igor Sutton
while(<@line>){ print if $_ =~ /The/ .. /east/ ; I suggest this: print join " ", (grep { /The/ .. /east/ } <@line>); -- Igor Sutton Lopes t: +55 51 9627.0779 e: [EMAIL PROTECTED]

extracting line between words

2006-09-14 Thread mayank . ahuja
Hi Perlers... I need to extract line between two words like @line = "The Sun rises in the east and "; Now I want to extract the line from The word to east For tht I am using the following code: #!/usr/bin/perl use warnings; use strict; my @line = "The Sun r