#!/usr/bin/perl use MIME::Entity; my $str = 'filler text to get the first char of line 2 to be a dot______ http://google.com'; print MIME::Entity->build( Data => $str, Type => 'text/plain', Encoding => 'quoted-printable', )->as_string; #### Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) filler text to get the first char of line 2 to be a dot______ http://google= .com= #### perl -MMIME::Entity -e 'print MIME::Entity->build(Encoding => "quoted-printable", Data => "some text\n.\nmore text")->as_string;' #### Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) some text =2E more text=