#!/usr/bin/perl -w use strict; my @fld_names; my @records; # # open your file here # # my $line = 0; while( ){ $line++; next if( $line == 1 ); next if( $line == 2 ); if( $line == 3 ){ @fld_names = split /\;/, $_; } else{ my @flds = split /\;/, $_; my %rec; for( my $i = 0; $i < @flds_names; $i++ ){ $rec{$fld_names[$i]} = $flds[$i]; } push @records, \%rec; } } ~