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( ' ', split ), "\n" } $line[ 0 ] =~ /(The.*east)/s;


> Or:
> 
> my @line = "The Sun rises in
>                 the east and ";
> $line[ 0 ] =~ s/\s+/ /g;
> print $line[ 0 ];

s/\s+/ /g, s/.*?(The.*east).*/$1/s for $line[ 0 ];
print "$line[ 0 ]\n";



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to