1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
#!perl
use strict;
use warnings;
use Carp;
use Overload::FileCheck q{:all};
mock_all_file_checks( \&my_custom_check );
sub my_custom_check {
my ( $check, $f ) = @_;
local $Carp::CarpLevel = 2; # do not display Overload::FileCheck stack
printf( "# %-10s called from %s", "-$check '$f'", Carp::longmess() );
# fallback to the original Perl OP
return FALLBACK_TO_REAL_OP;
}
-d '/root';
-l '/root';
-e '/';
-d '/';
unmock_all_file_checks();
__END__
# The output looks similar to
-d '/root' called from at t/perldoc_mock-all-file-check-trace.t line 26.
-l '/root' called from at t/perldoc_mock-all-file-check-trace.t line 27.
-e '/' called from at t/perldoc_mock-all-file-check-trace.t line 28.
-d '/' called from at t/perldoc_mock-all-file-check-trace.t line 29.
|