Think about Loose Coupling | |
PerlMonks |
references--hard vs anonymous operational weirdnessby hill (Sexton) |
on Mar 23, 2008 at 03:12 UTC ( [id://675719]=perlquestion: print w/replies, xml ) | Need Help?? |
hill has asked for the wisdom of the Perl Monks concerning the following question:
When this: $data{$tab} = \@array; is executed in a loop where $tab and @array change, every resulting $data{$tab} contains the value of the @array associated with the final $tab.
Changing the initial line to invoke an anonymous reference: Any explanations would be most welcome.
Back to
Seekers of Perl Wisdom
|
|