#! perl -slw use strict; use Storable; open DB, '<', '570563.dat' or die $!; my @index; my $offset = 0; while( ) { chomp; my @fields = split '\|'; push @{ $index[ $_ ]{ $fields[ $_ ] } }, $offset for 0,2,4,6,8,10,12; ## 7 x 100 byte fields indexed. $offset = tell DB; } close DB; store \@index, '570563.idx'; ## Index stored to file