ITmajor has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w # # Retrieve form selections & display the results # use strict; use File::Find; use CGI; my $q = new CGI; use GD::Graph::points; my $request = $ENV{"Query String"}; # Assign input to variables my $start_month= $q->param('month'); my $start_day= $q->param('day'); my $start_year= $q->param('year'); my $start_hour= $q->param('hour'); my $start_min= $q->param('min'); my $test_site= $q->param('center'); print $q->header("text/html\n\n"), $q->start_html(-title=>"Data Report"), "Report for $center from $start_hour:$start_min $start_month/$star +t_day/$start_year.\n"; #Find the file (yymmdd_site format) undef$/; find (sub { return if($_ =~ /^\./); return unless($_ =~ /\.txt/i); stat $Find::File::name; return if -d; return unless -r; open(FILE, "<$Find::file::name") or return; my $headercount = 1; my $discard = <FILE > for 1 .. headercount; While(<FILE>){ chomp; my ($timestamp, $out, $in) = (split m{"\t"}) [0, 3, 7]); my @data = (["timestamp", "$timestamp"), [$out, $in]); my $mygraph = GD::Graph::points->new(500,300); $mygraph->set( x_label => 'Time/Date', y_label => 'COunt', ) or warn $mygraph-> error; my $myimage = $mygraph->plot(\@data) or die $mygraph->error; print "Content-type: image/png\n\n"; print $myimage->png; close(FILE); }, '/(name of my directory tree)' $q->end_html;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: my image is not showing
by Corion (Patriarch) on Jul 08, 2008 at 15:52 UTC | |
by jhourcle (Prior) on Jul 08, 2008 at 17:51 UTC | |
|
Re: my image is not showing
by oko1 (Deacon) on Jul 08, 2008 at 16:51 UTC | |
|
Re: my image is not showing
by thezip (Vicar) on Jul 08, 2008 at 15:56 UTC | |
|
Re: my image is not showing
by moritz (Cardinal) on Jul 08, 2008 at 15:56 UTC |