open (FH, "$data_file); binmode FH; # set the block size as large practical # absolutely must be larger than any signature my $blocksize = 65536; # get length of largest signature my $signaturelength = ...; my $offset = 0; seek FH, $offset, 0; while (read FH, $block, $blocksize){ # check each signature against block for $signature (@def_inputs){ if (# search block for $signature){ # do signature found stuff } } # seek to next block $offset += ($blocksize - $signaturelength); seek FH, $offset, 0; } }