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

brian d foy brian.d.foy at gmail.com
Wed Oct 11 14:28:15 EDT 2006


On 10/11/06, Adrian Howard <adrianh at quietstars.com> wrote:
> On 7 Oct 2006, at 11:46, brian d foy wrote:
> [snip]
> > I've added a bunch of stuff to the Debugging chapter:
> >
> > http://www.pair.com/~comdog/mastering_perl/Chapters/04.debugger.html

> I kinda expected the print/warn section to move on to a discussion of
> logging modules, does that happen elsewhere?

Logging is different than debugging. :)

I think there is going to be a logging chapter. I just haven't gotten
that far yet.



> I'd stick in a warning about the problems with $SIG{ __DIE__ } and
> $SIG{ __WARN__ } and persistent environments like mod_perl.

I'm talking more about those in the chapter I'm working on now (the
Error Handling chapter), so I'll probably punt from the debugging
chapter to that chapter. Basically, don't do those things as a code
feature. It's a tool for diagnosis when you need a hook into the code
to figure out what's going on.

> fatalsToBrowsers - I'm in the "don't do this on live boxes" school
> since if you do have a bug it might reveal bad things to evil folk.
> Maybe worth warning folk of potential dangers?

Yes, good point.

> > And I think I'm mostly done with the Profiling chapter:

> I'd appreciate a little more emphasis on the dangers of unnecessary
> optimisation near the start.

Good idea.

> With Devel::Cover - might be worth mentioning Module::Build's built
> in support for ./Build testcover.

Good point.

> POD coverage modules?

I think  I got those in the pod chapter. I don't really count that as
part of Profiling though.

> Memory profiling? - Devel::Size, Devel::Size::Report, Devel::DumpSizes ?

See the Benchmarking chapter for that stuff. Note, however, that
currently Devel::Size is broken, so I'm not so keen about talking
about it too much. :)

Does anyone have tools, tricks, or tips for doing memory profiling on Windows?



-- 
brian d foy <brian.d.foy at gmail.com>
http://www.pair.com/~comdog/


More information about the Mastering-perl mailing list