in reply to Re: HTML static output
in thread HTML static output

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?

Replies are listed 'Best First'.
Re^3: HTML static output
by Corion (Patriarch) on Apr 16, 2014 at 07:17 UTC

    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.

Re^3: HTML static output
by Anonymous Monk on Apr 16, 2014 at 07:27 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?

    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