in reply to Interactive scripting with debugger
There's sure no better way to "become one" with a program, putting yourself "in its shoes" than running it inside an interactive debugger.
You might also like these tips and tricks;
- Putting the line kill 2, $$ will cause the debugger to break at that point in the source (on Unix, anyway). This works by emulating pressing Ctrl+C (it's the interrupt signal). This is great for setting breakpoints deep down in your code.
- If you ever turn strings into real functions via eval, then make sure to add a 'magic line number comment': eg,
If you do this, the emacs debugger will correctly step through the right source files. Sadly, though, the old perl5db.pl interactive debugger doesn't actually display the source properly.sub some_auto_generated_function { my $self = shift; # line 1 "some/preprocessedfile.foo" print $self->frop; # line 7 "originalfile.pm" } - Devel::ebug is a brand new debugger that doesn't have a lot of the limitations of the old debugger, in particular the segfaults, but instead brings a whole lot more new Storable related ones! Joy! But, anyway, this debugger is client/server with a very lightweight in-program "server", so you can debug remote programs. If you could write an emacs-compatible communication layer for it, you could bring this debugging to the "next level" of perl debuggers, which might include the debugger for Perl 6.
$h=$ENV{HOME};my@q=split/\n\n/,`cat $h/.quotes`;$s="$h/." ."signature";$t=`cat $s`;print$t,"\n",$q[rand($#q)],"\n";
In Section
Meditations