in reply to Re: Perl Gotchas.
in thread Perl Gotchas.

The fact that all branches of an if test are seen as being the same line goes back way farther than that. I remember being annoyed with it with Perl 5.005_03 and it wasn't new then.

However warnings.pm introduces some very annoying behaviour. It badly misused $Carp::CarpLevel with the result that their carps usually overflow the callstack and give them a cluck instead. But not always. If the error is deep in a stack of function calls, they may carp very near the surface. And certain kinds of import errors also occur at the wrong level.

Which goes to show that $Carp::CarpLevel was a bad idea. Unfortunately fixing warnings to use the new @CARP_NOT array to get more sensible behaviour is a lot of work because of the fact that every last annoying detail of the current misbehaviour has been nailed down by tests. :-(

A tip. Writing tests to nail down that code shall behave in an inconvenient way is a code smell. Fix the code to behave reasonably first and THEN write tests to guarantee that it won't change.