in reply to Re^3: Perl data notation
in thread Perl data notation

For the truly motivated, B::Deparse can serialize into a legible format.

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;
You could condition the tree by crawling it and clobbering anything with reftype CODE with sprintf 'sub %s', $deparse->coderef2text($hash{key}). But this still kills closures, and plus is a terrible, terrible idea.

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.