http://www.perlmonks.org?node_id=700667

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

When I run my code I get this error "Can't locate object method 'fetchrow_array' via package 'IO::File' at line 81 <_GEN_0> line 10." What am I doing wrong?
my $fh = IO::File->new_tmpfile or die "Unable to make new temp file: $ +!"; foreach $line (<FILE>) { ~~~~~blah blah~~~~~~ } my $data = GD::Graph::Data->new(); $data->read(file => ‘$fh’, delimiter => '\t'); $data = $data -> copy(wanted => [0, 1, 2 print <$fh>; while (my @row = $fh->fetchrow_array()) <------line 81 { $data ->add_point($row); } my $graph = GD::Graph::points->new(); $graph->set( x_label => 'Time/Date', y_label => 'Latency Count', title => "Latency Graph between $center1 and $center2", ) or warn $graph->error; my $image = $graph->plot($data) or die $graph->error; open(IMAGE, ">graph.png") or die "Not able to open image file\n"; + binmode IMAGE; print IMAGE $image->png or die "Problem writing to image file\n";