sub x(&) { my $coderef = shift; use Data::Dumper; print Data::Dumper->Dump([$coderef],['coderef']); { $_ = 'bumpkin'; $coderef->(); } } x { print "$_.YYY" };