How about this?
use strict; use Data::Dumper; sub print_code { my ($sub) = @_; my $d = Data::Dumper->new( [$sub] ); $d->Deparse(1); print $d->Dump(); }; print_code(sub{ print 'This is a coderef' });
In reply to Re^3: here-docs vs quote operators
by Corion
in thread here-docs vs quote operators
by ikegami
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |