my $bitstring = get_bitstring(); # Number of records is stored in first octet my $record_count = oct $bitstring; for my $i (0 .. $record_count - 1) { process_record( get_record($bitstring, $i) ); }