# find all the entities in the current file if (/entity\s+(\w+)\s+is/i) { $1{'name'} = $1; $1{'fname'} = $vhd_file; push @entities, \%1; } #### push @entities, \%{$1}; #### use Data::Dumper; .... # find all the entities in the current file if (/entity\s+(\w+)\s+is/i) { $hash{$1}{'name'} = $1; $hash{$1}{'fname'} = $vhd_file; push @entities, $1; } .... close VHD; } print Dumper(%hash); #### -_-_-_-_-_-_-_-_-_-_-_- My memory concerns me - but I forget why !!!