Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Dear monks, I am trying to use the Chart::plot module on a sun machine to get images for web-sites on the fly.

My old code for a linux machine is not working and I wondered if anyone could point out why?

I have narrowed the problem down to this bit here:

# draw the rest of the chart, and print it open (OUT,">plot.gif"); binmode OUT; print OUT $img->draw(); close OUT;

Replies are listed 'Best First'.
Re: Chart::Plot modules on a sun machine
by wazoox (Prior) on Jul 27, 2005 at 11:36 UTC
    Always check and report the result of a system action like "open", etc. Always write something like :
    open(OUT, ">plot.gif") or die "can't open! $!";
    or if you want your script to go on :
    open(OUT, ">plot.gif") or warn "can't open! $!";
    Update your code this way and see if there's an error message there that would enlighten you (hint: there's almost certainly one).
Re: Chart::Plot modules on a sun machine
by davorg (Chancellor) on Jul 27, 2005 at 11:36 UTC

    Chart::Plot seems to be a wrapper around the GD module. Have you installed GD (and the underlying libgd) correctly? Does GD pass all of its tests?

    As an aside, Chart::Plot seems to be a rather old an unmaintained module. Have you considered something a little more recent like GD::Graph?

    --
    <http://www.dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg