I ran this test script:
use strict;
use warnings;
use Test::More tests => 3;
use Carp;
ok(1<2);
pass();
fail();
croak "example";
using the command line prove -MCarp=verbose -v foo.pl
, and got the following errors:
Subroutine App::Prove::verbose redefined at /opt/ActivePerl-5.12/lib/App/Prove.pm line 407
App::Prove::_load_extension('App::Prove=HASH(0x683718)', 'Carp=verbose') called at /opt/ActivePerl-5.12/lib/App/Prove.pm line 419
App::Prove::_load_extensions('App::Prove=HASH(0x683718)', 'ARRAY(0x683850)') called at /opt/ActivePerl-5.12/lib/App/Prove.pm line 481
App::Prove::run('App::Prove=HASH(0x683718)') called at /opt/ActivePerl-5.12/bin/prove line 11
Undefined subroutine &Carp::verbose called at /opt/ActivePerl-5.12/lib/App/Prove.pm line 484.
If I run it using perl -MCarp=verbose foo.pl
there's no problem. What is causing prove
to reject verbose Carp? How can I get a full callstack from my tests when they croak
without global replacing croak
to confess
?