[Mastering-perl] Debugging, Profiling, and Cleaning Up Code

Florian Merges fmerges at cpan.org
Sat Oct 7 13:00:44 EDT 2006


Hi,

Debugging Perl
=========

The Best Debugger in the World
----------------------------------------

The print & warn statements on the examples, the copy&paste introduced
errores... it should be 'before' and 'after' not 'before' again.

I wouldn't use the [] to show things up when using Data::Dumper, because it
can confuse you when showing data structures...

I would say something as: Take a look to the Carp module documentation to
see others userful stuff... or something like: more on Carp module below.

Doing whatever I want
----------------------------

The __WARN__ and __DIE__ signal handlers could be explained more in detail:

"__WARN__ and __DIE__ hold the functions that perform the actions when I use
those functions. I can use a reference to a named subroutine or an anonymous
subroutine:..."

And I think it would be also good to say if the redefinition could create
side-effects, and if the call to die, still work if we define a sig handler
for __WARN__ and __DIE__.  --> just saw the footnote.

Program tracing
---------------------

There is also Sub::Override.

Wrapping subroutines
----------------------------

Why this way of getting the values for the var assignment?

@ARGV = qw( 5 6 );

my $n = shift @ARGV;
my $m = $ARGV[0];

...post-handler, and I get back 42.   => Should be 11.

perl5db.pl
-------------

Does anyone use this 'ddd'? ;-)



Regards,

Florian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://five.pairlist.net/pipermail/mastering-perl/attachments/20061007/87237b77/attachment.html


More information about the Mastering-perl mailing list