http://www.perlmonks.org?node_id=239409


in reply to Re: Re: catching newlines from textarea input
in thread catching newlines from textarea input

You may want to look at HTML::Entities instead of hand-rolling all your own entity encodings.