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:
>
> #!
Hi Mayank
Please add $\=" "; to your code as follows.
$\ is the output field separator.
#!/usr/bin/perl
use warnings;
use strict;
my @line = "The Sun rises in
the east and ";
my $store;
$\=" "; ## <- OUTPUT FIELD SEPERATOR##
while(<@line>){
print if $_ =~ /The/ ..
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]