in reply to One-liners: Conditionals in Loops
The trinary operator is another possibility. It allows an if.. else.. construction and can be nested. print /pattern/ ? "$_$/" : '' for @arr;
After Compline,Zaxo