>perl -wMstrict -le "sub rx (&$) { my $c_regex = shift; local $_ = shift; $c_regex->(); return $_; } ;; my $s = 'a b c'; print rx { s/ /_/g } $s; ;; my @ra = 'p q r'; print rx { s/ /_/g } @ra; " a_b_c 1 >perl -wMstrict -le "sub rx (&@) { my $c_regex = shift; local $_ = shift; $c_regex->(); return $_; } ;; my $s = 'a b c'; print rx { s/ /_/g } $s; ;; my @ra = 'p q r'; print rx { s/ /_/g } @ra; " a_b_c p_q_r