my (@date, @F_SCORE, @F_SCORE_BOX,This assignment makes @date gobble up all the values on the RHS, leaving the other arrays empty. A smaller example will illustrate this:
use warnings; use strict; use Data::Dumper; my ($date_ref) = [0..3]; my ($F_SCORE_ref) = [5..7]; my (@date, @F_SCORE) = (@$date_ref, @$F_SCORE_ref); print Dumper(\@date); print Dumper(\@F_SCORE); __END__ $VAR1 = [ 0, 1, 2, 3, 5, 6, 7 ]; $VAR1 = [];
From perldata:
You can actually put an array or hash anywhere in the list, but the first one in the list will soak up all the values, and anything after it will become undefined.You should consider a different data structure: perldsc
In reply to Re: Referencing/returning array of hashes from sub
by toolic
in thread Referencing/returning array of hashes from sub
by PoGGiE
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |