>perl -wMstrict -le "sub tr (&$) { $_[0]->($_[1]) } sub trx (&$) { $_[0]->($_[1]) } ;; $_ = 'foo'; print 'A: ', tr{ print qq{tr match: $_[0]} }/foo/; print 'B: ', trx{ print qq{trx match: $_[0]} }/foo/; " A: 0 trx match: 1 B: 1