Hi,

Perl: ActiveState 5.6.1, OS Windows 2000, IIS 5.0

I'm having troulble outputting a chart to a new window. If I call the below sample code from a form or an image tag within the same window the pie image is successfully returned to the browser. However, if I call the code with javascript's,
window.open("pie.pl?$passstring", "window name", "width=650,height=650 +")
the output prompts me to open or save the file. I guess it doesn't know where to return the output. Any ideas on how I can tell it to output to the current window or why it's trying to output as a file?
use GD::Graph::pie(350,350); @data=([@name], [@value]); $graph = new GD::Graph::pie; $graph->set( title => "$title", label => 'Label Goes Here', axislabelclr => 'black', '3d' => 1, start_angle => 90, suppress_angle => 5) or warn $graph->error; $graph->set_title_font(GD::Font->MediumBold); $graph->set_value_font(GD::Font->Small); $format=$graph->export_format; print header("image/$format"); binmode STDOUT; print $graph->plot(\@data)->$format() or die $graph->error;

Thanks.

Mitch

In reply to GD::Graph New Window by Mitch

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.