in reply to How to PRINT CGI html table to a PNG file
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:
Sys_Load.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;
CGI is awesome. Enjoy!#!/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;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: How to PRINT CGI html table to a PNG file
by hippo (Archbishop) on Aug 22, 2018 at 08:07 UTC | |
by Anonymous Monk on Aug 22, 2018 at 13:21 UTC | |
by hippo (Archbishop) on Aug 22, 2018 at 14:32 UTC | |
by Anonymous Monk on Aug 23, 2018 at 15:17 UTC | |
by Your Mother (Archbishop) on Aug 24, 2018 at 03:27 UTC | |
by Your Mother (Archbishop) on Aug 22, 2018 at 16:18 UTC | |
by Anonymous Monk on Aug 23, 2018 at 14:14 UTC | |
by Your Mother (Archbishop) on Aug 23, 2018 at 16:52 UTC | |
|