$body=~s/[\n\r]+$//; [download]
In reply to Re: Trim blanks from the beginning and end of a multi-line string by chessgui in thread Trim blanks from the beginning and end of a multi-line string by kenclark