where the two arrays @x_axis_array and @values_array have been previously filled in a while loop this code had been working before i tried to put it in a while loop so i no that the values are been filled into the arrays properly.. tanx in advance tommycahiruse CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser); use Socket; use Net::SNMP; use GD::Graph::lines; #function to print out a graph to screen using gd::graph sub print_graph#prints the graph to screen { my $q = new CGI; my ($xarray,$values,$xlabel,$ylabel,$title) = shift(@_); my @data = ($xarray,$values); my $graph = new GD::Graph::lines(500,350); $graph->set ( x_label => $xlabel, y_label => $ylabel, title => $title, x_label_skip => 'auto', y_label_skip => 'auto', line_width => 1, y_tick_number => 8, x_labels_vertical => 1, x_label_position => 1/2, transparent => 0, ); my $gd_image = $graph->plot(\@data); print $q->header(-type => "image/png"); binmode STDOUT; print $gd_image->png; } my $graphxlabel = "Time"; my $graphylabel = "No. Of Packets Recieved"; my $graphtitle = "No. Of Packets Recieved On Interface"; #function call print_graph(\@x_axis_array,\@values_array,\$grap +hxlabel,\$graphylabel,\$graphtitle);
In reply to passing multiple items to a subroutine by tommycahir
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |