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(
[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:
>
> #!
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
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]
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