sub foo(&@) { my $code = shift; # whatever ... } #### foo {$_ =~ /foo/} $a, $b, $c; #### foo({$_ =~ /foo/} $a, $b, $c); #### my @x = grep({$_ =~ /foo/} @list);
## foo {$_ =~ /foo/} $a, $b, $c; ##
## foo({$_ =~ /foo/} $a, $b, $c); ##
## my @x = grep({$_ =~ /foo/} @list);