#!/usr/bin/perl # http://perlmonks.org/?node_id=1202179 use strict; use warnings; my $good = [qw( allo mallo malo)]; my $bad = [qw( tillo sillo sallo)]; grep !/(.).*\1/, @$_ and print "@$_\n" for $good, $bad;