in reply to Re: Accessing a scalar value in another subroutine?
in thread Accessing a scalar value in another subroutine?
So you won't be able to inspect the docstring in advance.
But if that's OK for you you might wanna try PadWalker::peek_sub.
UPDATE:
Nope doesn't help, lexical are reset to undef after the function-scope is left.
DB<135> sub tst { my $doc="bla" } => 0 DB<136> PadWalker::peek_sub(\&tst) => { "\$doc" => \undef } DB<137> tst() => "bla" DB<138> PadWalker::peek_sub(\&tst) => { "\$doc" => \undef }
Cheers Rolf
|
|---|