Right. I've tried creating the graph object, and passing it in a URL to a second Perl script like so:

1st Perl script:

use strict; use warnings; use CGI qw/:standard *table *Tr *td/; use CGI::Carp qw(fatalsToBrowser); use Date::Manip; use DBI; use GD::Graph; use GD::Graph::bars; use GD::Graph::lines; use GD::Graph::histogram; ... (snip HTML and form generation code plus database interrogation code) ... my $graph=GD::Graph::bars->new(); my $format=$graph->export_format; $graph->set ( x_label=>'Uploaders', y_label=>'Total number of uploads' ); @bar_data=(\@x-axis, \@bars); my $gd=$graph->plot(\@bar_data)->$format() or die $graph->error; print '<img src=http://foobar.com/foobar.pl?image=$gd&format=$format>' +;#sends the parameters to the second script
And the second Perl script:
#!/usr/bin/perl -w use strict; use warnings; use CGI qw(:standard); my $image=param('image'); my $format=param('format'); print header("image/$format"); binmode STDOUT; print $image;
However, I just get a blank where the image should be when I do this. I know the image object is created properly, but passing it as a parameter just doesn't seem to work.

Any ideas as to what I'm doing wrong?


In reply to Re^3: Use of GD::Graph by campbell
in thread Use of GD::Graph by campbell

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.