in reply to cannot view png file from Graph::GD module

#!/usr/bin/perl -w
It appears from your shebang line that you have enabled warnings. If that is the case, then you are ignoring the warning messages which are generated when your code runs. For example, these 3 lines generate warnings:
$day = @timedata[3]; $month = @timedata[4] + 1; $year = 1900 + @timedata[5];

This may have nothing to do with your problem, but I wonder if you are ignoring some important warnings. It is also a good practice to use strict; (see use strict and warnings).

Replies are listed 'Best First'.
Re^2: cannot view png file from Graph::GD module
by Argel (Prior) on Apr 07, 2010 at 20:49 UTC
    Off-topic: Will -w cause perl to fire warnings for CGI.pm code? I thought that was one reason the warnings pragma is considered a better choice.

    Elda Taluta; Sarks Sark; Ark Arks

      From the CGI documentation:
      If you use the -w switch, you will be warned that some CGI.pm argument names conflict with built-in Perl functions. The most frequent of these is the -values argument, used to create multi-valued menus, radio button clusters and the like. To get around this warning, you have several choices:
Re^2: cannot view png file from Graph::GD module
by rakheek (Sexton) on Apr 08, 2010 at 01:03 UTC
    Hi Monk, Actually after playing with the image for a while I found that the "Save Image" is actually saving my HTML from the form from previous page which invokes the Graph. So, actually save image is not saving a png file. Any clues to what I am doing wrong? Also, is this a perl GD limitation? Thanks for any suggestions. Regards, Rakhee
      the "Save Image" is actually saving my HTML

      So you're trying to debug your browser "Save Image" functionality? Wrong forum.

        Since I am using Perl GD to output a png image, is this still a browser issue? Browser(both IE and Mozilla) plot the graph, so they recognize the png format? I am sure I am missing something in the perl GD module. Regards, Rakhee