$Library_Index{<$Library>} = tell($library), scalar <$Library> until eof($Library); #### #! perl -slw use strict; use Storable qw[ store ]; print time; my %idx; $idx{ <> } = tell( STDIN ), scalar <> until eof STDIN; store \%idx, '1031021.idx' or die $!; print time; #### C:\test>1031021-i.pl <1031021.dat 1367160156 1367160362 C:\test>dir 1031021* 28/04/2013 15:30 193 1031021-i.pl 28/04/2013 15:04 5,272,940,608 1031021.dat 28/04/2013 15:46 316,385 1031021.idx 28/04/2013 15:29 374 1031021.pl #### #! perl -slw use strict; use Storable qw[ retrieve ]; print time; my $idx = retrieve '1031021.idx' or die $!; print time; open DAT, '+<', '1031021.dat' or die $!; for( 1 .. 1000 ) { my( $id, $offset ) = each %$idx; seek DAT, $offset, 0; my $vid = ; die 'mismatch' unless $id eq $vid; my $data = ; } close DAT; print time; #### C:\test>1031021.pl 1367160624 1367160624 1367160651