in reply to Help needed in populating the hash
#!/usr/bin/perl use strict; use warnings; use Data::Dumper::Concise;; my(%x) = (qw(1 2 3 4)); my $ref = \%x; my $i; for ($i = 1; $i<5; ++$i) { $x{$i} = 'x'; } print Dumper($ref); [download]