in reply to Segmentation fault

Please check the value of $i. Most probably it has a wrong value, so $tot-Mem[$i] is somewhere "out of bounds".

Replies are listed 'Best First'.
Re^2: Segmentation fault
by kibs (Initiate) on Feb 08, 2012 at 12:52 UTC
    the $i is in the code below:
    # save the values from the 2-dimensional into a 1-dimensional array for $i ( 0 .. $#vals ) { $tot_mem[$count] = $vals[$i][1]; $count++; } my $tot_mem_sum = 0; # calculate the total of all values for $i ( 0 .. ($count-1) ) { $tot_mem_sum = $tot_mem_sum + $tot_mem[$i]; }