in reply to HTML static output

Please let me know how to store the data in html & send it via email. Thanks.

I have some ideas, like save the html and not the text

Use the Perl documentation and CPAN and MetaCPAN search engine to find modules for "format html" and "safe html" and "send mail" and "email attach html"

Then look and pick one thing which has good reviews good comments and lots of tests and lots of pass tester reports and

And pick one and give it a try to see if it works for you :)

Replies are listed 'Best First'.
Re^2: HTML static output
by unixdisk (Initiate) on Apr 16, 2014 at 07:11 UTC

    I'll repharse my question:Collect system information from unix server like df, ntpq, etc this output is like txt output instead of that need in html output, how to do it?

      The really easy way is to output the text in HTML like the following:

      use HTML::Escape 'escape_html'; my $text= collect_output_as_txt( @servers ); my $title= "Report for servers " . join ",", @servers; $text= escape_html( $text ); print <<HTML; <html> <head><title> $title </title></head> <body> <pre> $text </pre> </body> </html> HTML

      If you want more fancy formatting, you will need to parse the output of each command and then fill the HTML appropriately.

      I'll repharse my question:Collect system information from unix server like df, ntpq, etc this output is like txt output instead of that need in html output, how to do it?

      Well ok, that takes care of "save the html" portion, for the rest, my idea, I'd solve the problem the exact same way

      I'd probably use what Corion said in addition to
      HTML::FromText - converts plain text to HTML
      Text::Autoformat - Automatic text wrapping and reformatting