in reply to Re: 2d Array - making an array for the column then adding the values
in thread 2d Array - making an array for the column then adding the values
Are you suggesting to not even use the column slice so it's a 1D array?sub score_count { my @arr = shift; my $total = 0; foreach my $score (@arr) { print "@$score "; ##prints actual values; If @ taken out, +values printed are like ARRAY(0x95533e0) $total += @$score; ##if @ is taken out the summation is somewhe +re ~140915576; however, with the @, the values are still incorrect. } print "$total\n"; return $total; }
Thanks for letting me know about if construct issue but I do want to skip the line if it is false so that code should be correct.
Thanks for the help
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: 2d Array - making an array for the column then adding the values
by ikegami (Patriarch) on Sep 21, 2009 at 02:35 UTC | |
|
Re^3: 2d Array - making an array for the column then adding the values
by toolic (Bishop) on Sep 21, 2009 at 03:03 UTC |