in reply to Concise foreach expression
use strict; use warnings; my @names = ('ABC','123test','DEF','Gibberishafdaf','Moretest','Gibber +ishafdaf'); ($_ =~ /test$/) ? print "[$_] Pattern found\n": print "[$_] Pattern NO +T found\n" , for(@names); [download]