We don't bite newbies here... much | |
PerlMonks |
RE: Re: searching backwards in a stringby Anonymous Monk |
on Jun 14, 2000 at 03:36 UTC ( [id://18009]=note: print w/replies, xml ) | Need Help?? |
>>
while($text =~ /(.{0,80})\s+/g) {
# result in $1
}
<<
I believe that the above snippet is an infinite loop. However, if TEXT is a filehandle then while(<TEXT> =~ /(.{0,80})\s+/g){ # result in $1 } should kill all trailing space and line returns.
Isn't that what chomp is for, though?
In Section
Seekers of Perl Wisdom
|
|