http://qs321.pair.com?node_id=17875


in reply to Re: searching backwards in a string
in thread searching backwards in a string

>> 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?