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

Q&A > regular expressions > How do I handle mid-line carriage returns in a flatfile database? - Answer contributed by cianoz

Usually i prefer to uri-encode multiline fields so i can preserve LF and CR... you can do this way:
use URI::Escape; my $safe_field = uri_escape($field); ## now you can put $safe_field in the db ## without worry about CR/LF a ## restore it: $field = uri_unescape($safe_field);