in reply to Turning a reference to a subroutine back into code
Another alternative is B::Deparse
use B::Deparse; sub dumpsub { print "sub ",B::Deparse->new->coderef2text(shift),"\n" } dumpsub \&dumpsub;
Output:
sub { BEGIN {${^WARNING_BITS} = "\377\377\377\377\377\377\377\377\377\37 +7\377\177"} use strict 'refs'; print 'sub ', 'B::Deparse'->new->coderef2text(shift @_), "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Turning a reference to a subroutine back into code
by citromatik (Curate) on Apr 18, 2008 at 08:44 UTC |