http://qs321.pair.com?node_id=578470

valavanp has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, when i push hash values in an array, it gets added. But when i push it through reference it is not getting added. I am not giving the full code, only a part of it. Here is the code which i used, please correct me where i am wrong:
#!/usr/local/bin/perl use strict; use warnings; %h=('1', 'one', '2', 'two', '3', 'three'); @arr=(1,2); foreach $key(keys %h) { push(@arr,$h{$key}); } print @arr; @arr=(3,4,5); foreach $key(keys %h) { push(@arr,$$h{$key}); print "@arr\n"; }