use strict; use warnings; use HTML::FormatRTF; use LWP::Simple; my $outfile = 'test.rtf'; my $address = 'http://www.sec.gov/Archives/edgar/data/1557421/' . '000100201412000509/iogcs1-9132012.htm'; my $content = get($address); defined $content or die "Cannot read '$address': $!"; open(my $rtf, '>', $outfile) or die "Cannot open file '$outfile' for writing: $!"; print $rtf HTML::FormatRTF->format_string($content); close $rtf or die "Cannot close file '$outfile': $!";