.. not being able to do, reduced to nitpicking. Sorry your answer was so beautiful I studied it but.. perl -e '@data=qw(1 2 3 4 5 6 7 8 9 10 11); foreach (grep {not (/1/../3/) =~ /^1?$|E/ } @data) { print "o> $_\n"; } '