There's more than one way to do things | |
PerlMonks |
Re: Silencing warnings when testingby Ovid (Cardinal) |
on Oct 28, 2002 at 02:07 UTC ( [id://208432]=note: print w/replies, xml ) | Need Help?? |
I typically use typeglobs to override the sub and capture the arguments. Then, you can test whether or not carp was called and if it received the correct arguments. Below is a test script.
Just make sure that you localize the typeglob. This ensures that subsequent calls to carp that you forgot to trap will still spit out error messages. Cheers, Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
In Section
Seekers of Perl Wisdom
|
|