Enbugger::Restarts - Reach around in your stack and restart execution from arbitrary places
Here's a quick example of redefining a function you're currently in, then restarting execution from the start.
Loading DB routines from perl5db.pl version 1.3 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::foo(blarg:2): foo() DB<1> sub foo { print "Hello world!\n" } # new version DB<2> rat 1 DB<3> c Hello world!
I'm trying to get a little of Smalltalk's debugger features for Perl 5. The standard Perl debuggers all let you redefine functions including functions that are currently executing. This extension allows you to restart execution at the beginning of whatever is currently at some point on your call stack.
The below functions describe a call stack:
two(); sub two { three() } sub three { five() } sub five { seven() } sub seven { ... } main -> two -> three -> five ->seven <- <- five <- three <- two <- main
The restart_at extension lets you restart a particular level:
restart_at
sub seven { DB::restart_at(3) if $not_restarted++ } main -> two -> three -> five ->seven restart_at( 3 ) -> three -> five -> seven <- <- five <- three <- two <- main
Restarts the function at caller(N) level.
To install this module, run the following commands:
perl Makefile.PL make make test make install
After installing, you can find documentation for this module with the perldoc command.
perldoc Enbugger::Restarts
You can also look for information at:
Josh ben Jore >jjore@cpan.org<
Copyright (C) 2008 WhitePages.com, Inc. with primary development by Joshua ben Jore.
This program is distributed WITHOUT ANY WARRANTY, including but not limited to the implied warranties of merchantability or fitness for a particular purpose.
The program is free software. You may distribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation (either version 2 or any later version) and the Perl Artistic License as published by O’Reilly Media, Inc. Please open the files named gpl-2.0.txt and Artistic for a copy of these licenses.
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in 'O’Reilly'. Assuming UTF-8
To install Enbugger::Restarts, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Enbugger::Restarts
CPAN shell
perl -MCPAN -e shell install Enbugger::Restarts
For more information on module installation, please visit the detailed CPAN module installation guide.