my $str = join '',(648040620,637132715,649986572,648040620 ); my $proteins_count = length ($str)/9; my %uniq; do { $uniq{$_}++ unless $uniq{$_} } for unpack "(A9)$proteins_count" , $str; print "@{[keys %uniq]}\n";