my %h = (); foreach(@_) { $h{something} = $_; # changes the %h above every time push @something, {%h}; # copies the accumulated changes into @something }