in reply to Re: TRIM in Perl?in thread TRIM in Perl?
Why do you add /m to your regular expressions? See perlop - /m changes the meaning of $ and ^.