in reply to Assertions and Logging
sub assert ($;$) { unless($_[0]) { require Carp; Carp::confess( _fail_msg($_[1]) ); } return undef; } [download]
If you don't use Carp::confess elsewhere, you could override it to call Log::Log4perl.