use strict; use B::Deparse; my $deparse = B::Deparse->new(); my $func = sub { my %hash = @_; return $hash{a}; }; my $body = $deparse->coderef2text($func); print $body;