#!/usr/bin/perl -wT # gd_count.pl use strict; use Untaint; use GD; use CGI qw(param header); print header("image/png"); my $counter = untaint(qr(.*\.dat$), param('counter')); open(LOG, $counter) || die "Can't read counter. $!"; my $log = ; close LOG; my $im = new GD::Image((length($log)*9),20); my $black = $im->colorAllocate(0,0,0); my $white = $im->colorAllocate(255,255,255); $im->string(gdLargeFont,2,2,$log,$white); binmode(STDOUT); print $im->png;