Just another Perl shrine | |
PerlMonks |
Re: local and global variable problemby Athanasius (Archbishop) |
on Apr 30, 2014 at 15:59 UTC ( [id://1084522]=note: print w/replies, xml ) | Need Help?? |
Hello madM, I’m assuming that each call to $matrix->{$key}->{$key2} returns a single scalar value? In any case, each time the assignment:
is executed, it overwrites the array @matrix_numbers with a new value. What you need is:
See push. (I don’t understand why the array is empty — it should contain some value after the two foreach loops end.) Hope that helps,
In Section
Seekers of Perl Wisdom
|
|