foreach( @_ ) { my %new_hash = (something => $_ ); # make a new hash push @something, \%new_hash; # push it onto the stack }