I'm just going to show you how to use CGI;

In your program you do "use CGI" but then you don't actually use it! By using ':standard' it gives you an easy way to type HTML that is much cleaner than HTML so it's easy to understand and edit. Here are your 2 exact programs using all the juicy CGI shortcuts for HTML.

home.cgi:

#!/usr/bin/perl use strict; use warnings; use CGI qw/:standard center/; my $date = localtime; print header.start_html(-bgcolor=>'#c0e0f9').br. center( h1('Home'). h3($date). img({src=>'root_partition.cgi' }).br.br.br. img({src=>'var_partition.cgi' }).br.br.br. img({src=>'stacked_Bar_graph.cgi' }).br.br.br. img({src=>'topsenders_hbar.cgi' }).br.br.br. img({src=>'toprecipients_hbar.cgi'}).br.br.br ).end_html;
Sys_Load.cgi:
#!/usr/bin/perl use strict; use warnings; use CGI ':standard'; use Sys::Load qw/getload uptime/; my ($one_m, $five_m, $fifteen_m) = (getload())[0,1,2]; print header.start_html(-bgcolor=>'#c0e0f9'). table({-style=>'width:20%'},caption('Load Average'), Tr( th({-bgcolor=>'#FFDD00',-height=>'25'},'1 Minute' ). th({-bgcolor=>'#FFDD00',-height=>'25'},'5 Minutes' ). th({-bgcolor=>'#FFDD00',-height=>'25'},'15 Minutes') ), Tr({-style=>'font-family:veranda',-bgcolor=>'#FFFFFF'}, td($one_m), td($five_m), td($fifteen_m) ) ).end_html;
CGI is awesome. Enjoy!

In reply to Re: How to PRINT CGI html table to a PNG file by Anonymous Monk
in thread How to PRINT CGI html table to a PNG file by theravadamonk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.