in reply to regexp word break help

Try this (assuming you want to see the entire original string, broken into lines of less than 45 characters each):
while (length($longstring)>45) { my $break = rindex( $longstring, " ", 45 ); print substr( $longstring, 0, $break ), $/; $longstring = substr( $longstring, $break ); } print $longstring;