On 13/06/2012 02:33, Mike Flannigan wrote:
Anybody know why the script below does not work? I can get HTML::TextToHTML to work fine with the infile option, but not the instring option. My htmlout.htm end up with just these 2 lines: </BODY> </HTML> I expected it to have abcdefghijklm in it. More info on HTML::TextToHTML options is located here: http://txt2html.sourceforge.net/txt2html.html#options_files Mike Flannigan # # # This script converts TXT to html. # # use strict; use warnings; use HTML::TextToHTML; my $html_file = 'htmlout.htm'; #my $texttemp = "abcd\nefghij\nklm"; my $texttemp = "abcdefghijklm"; # create a new object my $conv = new HTML::TextToHTML(); # convert a file $conv->txt2html(instring=>[$texttemp], outfile=>$html_file, title=>"Title", mail=>1, ); print "\nAll done.\n";
Hey Mike This is a bug in HTML::TextToHTML. I have emailed the author. In the mean time, if you want to fix your own copy you should modify the module file HTML/TextToHTML.pm. Line 1521, which reads $para = $_; should be changed to $para = $source; HTH, Rob -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/