use strictures; use Data::Dump "dump"; my @col = qw( count grade position name date country age vacant ); my @records; for ( ) { my %tmp; @tmp{@col} = split ":"; push @records, \%tmp; } dump \@records;