in reply to Concise foreach expression
print"$path_name\n"for grep/test$/,@names; [download]
I doubt it runs faster.
print"$path_name\n"x grep/test$/,@names; say$path_name x grep/test$/,@names; [download]
/test$/&&print$path_name,$/for@names; /test$/&&say$path_name for@names; [download]
If he meant $x where he had $path_name,
print"$_\n"x grep/test$/,@names; say for grep/test$/,@names; [download]
/test$/&&print$_,$/for@names; /test$/&&say for@names; [download]
print/.*test$/g,$/ for@names; say/.*test$/g for@names; [download]