LinuxÒÁµéÔ°ÂÛ̳'s Archiver

blackspace ·¢±íÓÚ 2005-1-3 16:57

PadWalker - play with other peoples' lexical variables

PadWalker is a module which allows you to inspect (and even change!) lexical variables in any subroutine which called you. It will only show those variables which are in scope at the point of the call.

The peek_my routine takes one parameter, the number of call levels to go back. (It works the same way as caller() does.) It returns a reference to a hash which associates each variable name with a reference to its value. The variable names include the prefix, so $x is actually '$x'.

[url]http://search.cpan.org/~robin/PadWalker-0.10/PadWalker.pm[/url]

Ò³: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.