Not for the latest version - but the -w switch and use strict; are always helpful with debugging as they provide informative error messages. You can, of course, run under the regular debugger using:
perl -d myscript
Gurusamy Sarathy
<gsar@engin.umich.edu>
has built a PERL5DB file called Tkperldb (which despite the name is for
pTk not Tk/perl). One must install an early de-bugger then apply a patch to
bring the debugger up to date.
The early debugger kit is available from:
ftp://ftp.perl.com/pub/perl/ext/TK/Tkperldb-a1.tar.gz
And Gurusamy Sarathy notes that the patch to bring the debugger up to date is
available at:
You need a post 5.001m perl that has support for debugging closures. Or you can simply apply: http://www-personal.umich.edu/~gsar/perl5.001m-bugs.patch to 5.001m. (5.002beta includes all the fixes in the above patch).Note that a perl debugger may be invoked within your script with a line like:
$ENV{'PERL5DB'} = 'BEGIN { require Tkperldb }';
See
man perldebug(1) for more help.
Keep in mind that you are programming in perl after all. The perl debug line mode is available to you through executing the following from your shell:
perl -de 0
Whereupon you must enter all the lines of a script including
use Tk;. (Fancier file reads & evals are
possible - but if you are getting that sophisticated why not
create your own custom PERL5DB file?)
When using perl -dwe 0 beware of the emacs like
line editing under this debugger, and
be forewarned that as soon as you type in the MainLoop;
statement perl will no longer read from <STDIN>.
Ilya Zakharevich <ilya@math.ohio-state.edu> points out that very recent perldb versions will allow for simultaneous X and STDIN reads. He also points out:
Note that you may use
sub myLoop {
if (defined &DB::DB) {
while (1) { # MainWindow->Count
Tk::DoOneEvent(0);
}
} else {
MainLoop;
}
}
(and I hope the analogous provision will be in MainLoop in
tk-b9 - hi, Nick ;-)
Previous | Return to table of contents | Next