##
/test$/&&print$path_name,$/for@names;
/test$/&&say$path_name for@names;
####
print"$_\n"x grep/test$/,@names;
say for grep/test$/,@names;
####
/test$/&&print$_,$/for@names;
/test$/&&say for@names;
####
print/.*test$/g,$/ for@names;
say/.*test$/g for@names;