title: Perl GD module PNG image corrupt or cant open
body: <p>I am running Windows 10 and I've installed Perl v5.26.1, built for MSWin32-x64-multithread. Binary build 2601 [404865] provided by ActiveState.</p>
  
  <p>My problem is I want to use the GD::Graph.</p>
  
  <p>Everything looked fine. I wrote a code and did a syntax check and everything was fine. When I run the script all I get is nonsense though. I tried outputting to *.png file instead, but the file is corrupt.</p>
  
  <p>This is driving me bonkers. What am I doing wrong here? Any help would be much appreciated. The following is the code</p>
  
  <pre><code>#!usr/bin/perl -w
  use strict;
  use GD::Graph::area;
  # File: prob1.pl
  
  my @x = (0, 0, 0.00759, 0.018975, 0.036053, 0.216319, 0.449715, 0.648956, 
  0.815939, 0.935484, 1);
  my @y = (0, 0.053763, 0.16129, 0.308244, 0.577061, 0.792115, 0.874552, 
  0.924731, 0.964158, 0.989247, 1);
  
  my @data = (\@x, \@y);
  
  my $graph = GD::Graph::area-&gt;new(500, 300);
  
  $graph-&gt;set( x_label=&gt;'False Positive Rate', y_label=&gt;'True Positive 
  Rate',title=&gt;'ROC Curve') or warn $graph-&gt;error;
  
  my $image = $graph-&gt;plot(\@data) or die $graph-&gt;error;
  
  open IMG, "&gt;prob1.png" or die "can't open prob1.png\n";
  print IMG $image-&gt;png;
  exit;
  </code></pre>