in reply to Re: Re (tilly) 2: Confusion about properly using Carp
in thread Confusion about properly using Carp
What if someone calling your code wants to do what you are doing? They can't because no matter what they do with $Carp::CarpLevel, you are overriding them.
What if someone wants to later modify your code? They don't realize that somewhere in the guts you have hardcoded an assumption about the shape of the call-stack. So your code is fragile.
What if you are wrapping a module which might croak? If so then your callstack calculation is almost surely wrong. Read the guts of Carp to find out why.
What if you are wrapping a module which might croak and might confess? If so then there is no single way to get the right desired result.
And on and on. I gave this topic a lot of thought, and I concluded that what you are trying to do is a bad idea. The fact that many people (like you) think they know what they are doing and get it wrong consistently just convinces me of that even more.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re (tilly) 4: Confusion about properly using Carp
by steves (Curate) on Mar 03, 2002 at 10:41 UTC | |
by tilly (Archbishop) on Mar 04, 2002 at 04:10 UTC |