use CGI ':standard';
You don't appear to be using this anywhere in your script. Why not remove it?
my $cmd_1 = "sudo df -h |grep /var |awk '{print \$2}' | sed -e 's/.\$/ +/'"; my $cmd_2 = "sudo df -h |grep /var |awk '{print \$3}' | sed -e 's/.\$/ +/'"; my $result_used = qx/ $cmd_1 /; #$result_used shows 1.4 my $result_free = qx/ $cmd_2 /; #$result_free shows 85
You shell out, sudo and pipe through a grep an awk and a sed from perl! Twice. Let's try another way.
my @df = `df /var`; my ($used, $free) = (split (/\s+/, $df[1]))[2,3];
Don't pass -h to df when using a script. You can easily end up with MB vs GB and then you'll have real confusion. Better yet, use something like Linux::Info::DiskUsage to avoid shelling out entirely.
I think Doughnut chart is NICER. But, I can't find many docs for them.
You already have the image as a pie so why not just overlay a background-coloured circle on the middle?
In reply to Re: doughnut charts with gd:graph
by hippo
in thread doughnut charts with gd:graph
by theravadamonk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |