in reply to GD::Graph without saving file

1. You're forgetting to binmode. 2. That's not how you deal with headers in mason (see Re: OT: HTML::Mason & apache redirects)

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.

Replies are listed 'Best First'.
Re^2: GD::Graph without saving file
by neilwatson (Priest) on Jul 07, 2004 at 23:54 UTC
    OK so using binmode and the Mason way of headers (all within %init instead of %perl):

    ....snip... my $gd = $graph->plot(\@data) or die "Could not plot: ".$graph->error. Dumper(@data); my $img = $gd->png(); $r->content_type("image/png"); $r->send_http_header; binmode STDOUT; $m->print($img); $m->abort(OK); # make sure nothing else gets sent
    Still not working.

    Neil Watson
    watson-wilson.ca

      Still not working.

      If you comment out the

      $m->print($img);

      line and make the request by hand (e.g., in a telnet session to port 80), what do the headers look like?

Re^2: GD::Graph without saving file
by neilwatson (Priest) on Jul 07, 2004 at 23:38 UTC
      Why? Just binmode, it can't hurt.

      MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
      I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
      ** The third rule of perl club is a statement of fact: pod is sexy.