#!/usr/bin/env perl use strict; use warnings; use constant MIN_LENGTH => 10; # 1+2+3+4 RECORD: while (<>) { next RECORD unless MIN_LENGTH < length; next RECORD unless /^([a-z]+)$/; my %char_count_of; $char_count_of{substr $1, $_, 1}++ for 0 .. length($1) - 1; my $check = 1; for (sort { $a <=> $b } values %char_count_of) { next RECORD unless $_ eq $check++; } print; } #### $ pm_1201500_dict_char_ordered_count.pl /usr/share/dict/words beerbibber chachalaca isoosmosis kotukutuku rememberer sereneness sleeveless #### use constant MIN_LENGTH => 6; # 1+2+3 #### $ pm_1201500_dict_char_ordered_count.pl /usr/share/dict/words | head -5 allele amamau ananas ananda annona #### $ pm_1201500_dict_char_ordered_count.pl /usr/share/dict/words | tail -5 ubussu venene wedded weeded weewow