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

I was hoping you could help me out. My problem occurs using the rtr-graph script, a perl script program developed my John Shearer. He tried to help, but to no avail.

I get this error when trying to execute the rtr-graph:
# /usr/local/bin/rtr-graph --cfg traffic.cfg Can't call method "png" on an undefined value at /usr/local/bin/rtr-gr +aph line 123. # more rtr-graph $my_graph->set_legend_font ("gdMediumBoldFont"); $my_graph->set_legend( 'Traffic Out', 'Traffic In' ); my $gd = $my_graph->plot(\@data)->png; open (IMG, ">$tmp_dir/graph.$name.$int.png") or die; binmode IMG; print IMG $gd; close IMG; #####

John, the developer of the script, told me to verify if I had the files referenced in the script and whether they had data.

Here are my files:
[root@atilla tmp]# ls -ltr total 52 -rwxrwxrwx 1 root root 30 Oct 20 13:33 traf.traffic.2 +0031020.6 -rwxrwxrwx 1 root root 21 Oct 20 13:33 traf.traffic.2 +0031020.5 -rwxrwxrwx 1 root root 15 Oct 20 13:33 traf.traffic.2 +0031020.4 -rwxrwxrwx 1 root root 15 Oct 20 13:33 traf.traffic.2 +0031020.3 -rwxrwxrwx 1 root root 30 Oct 20 13:34 traf.traffic.2 +0031020.2 -rwxrwxrwx 1 root root 45 Oct 23 18:33 traf.traffic.2 +0031023.2
and the data within the files is:
more traf.traffic.20031023.2 1066934467 0 0 1066947054 0 0 1066948418 0 0 1066948473 0 0

If you could point me in the right direction at all, I would really appreciate it.

edited: Fri Oct 24 17:59:08 2003 by jeffa - code tags

Replies are listed 'Best First'.
Re: Can't Call Method png, need help
by BrowserUk (Patriarch) on Oct 24, 2003 at 15:30 UTC

    It sounds like you could have a downlevel version of GD that doesn't support the png() method. You can get the latest greatest version from CPAN, or directly from the authors website at latest GD

    You will probably also need to verify that you have the latest version of libgd. You'll find a link to that close to the bottom of the page via the link above.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    Hooray!

Re: Can't Call Method png, need help
by idsfa (Vicar) on Oct 24, 2003 at 15:35 UTC

    This is a FAQ for GD::Graph. To help beyond that, we'd need to see (more of) the rtr-graph code.

    # Wild guess my $plot = $my_graph->plot(\@data) or die $my_graph->error; my $gd = $plot->png;

    Remember, when you stare long into the abyss, you could have been home eating ice cream.