open(DATFILE, "<$datfilename") or die $!; binmode(DATFILE); read(DATFILE, $_, 4, 0); # Read 4 bytes of the general information foreach (0..110){ read(DATFILE, $_, 4, 0); # Read 4 bytes of the profile ID read (DATFILE, $_, 2, 0); # Read 2 bytes of the sequencelength &ReadData ($profilelength); # read the first sequence read (DATFILE, $_, 2, 0); # Read 2 bytes of the trailing zero &ReadData ($profilelength); # read the second sequence read (DATFILE, $_, 2, 0); # Read 2 bytes of the trailing zero }