open (my $fd, '<','./dump2.txt') or die "Can't open dump2.txt"; while (<$fd>) { chomp; my @dump = split(/\t/); my $tbl_last = "FIL"; foreach my $it (@dump) { if ($it =~ m/([A-Z]{3})\.(.+)/) { my $tbl = $1; my ($col, $val) = split('=',$2); # print "$it\t$tbl\t$col\t$val\n"; my @tmp = (); if ($tbl eq $tbl_last) { push(@tmp,$col,$val); } else { my %$tbl = (@tmp); $tbl_last = $tbl; print Dumper \%$tbl; } } } }