in reply to Concise foreach expression
In this case you could use grep:
print "$_\n" for grep {/test$/} @names;
UPDATE: ...or more cryptically: /test$/ and print "$_\n" for @names;.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Concise foreach expression
by toolic (Bishop) on Aug 29, 2014 at 12:17 UTC | |
by hdb (Monsignor) on Aug 29, 2014 at 12:20 UTC | |
by LanX (Saint) on Aug 29, 2014 at 12:54 UTC |