3 # this file is an utra-lightweight stub. The first time a function is
4 # called, Carp::Heavy is loaded, and the real short/longmessmess_jmp
7 # $MaxEvalLen, $Verbose
8 # are supposed to default to 0, but undef should be close enough
11 $MaxArgLen = 64; # How much of each argument to print. 0 = all.
12 $MaxArgNums = 8; # How many arguments to print. 0 = all.
16 @EXPORT = qw(confess croak carp);
17 @EXPORT_OK = qw(cluck verbose longmess shortmess);
18 @EXPORT_FAIL = qw(verbose); # hook to enable verbose mode
20 # if the caller specifies verbose usage ("perl -MCarp=verbose script.pl")
21 # then the following method will be called by the Exporter which knows
22 # to do this thanks to @EXPORT_FAIL, above. $_[1] will contain the word
25 sub export_fail { shift; $Verbose = shift if $_[0] eq 'verbose'; @_ }
27 # fixed hooks for stashes to point to
28 sub longmess { goto &longmess_jmp }
29 sub shortmess { goto &shortmess_jmp }
30 # these two are replaced when Carp::Heavy is loaded
31 sub longmess_jmp {{ local($@, $!); require Carp::Heavy} goto &longmess_jmp}
32 sub shortmess_jmp {{ local($@, $!); require Carp::Heavy} goto &shortmess_jmp}
34 sub croak { die shortmess @_ }
35 sub confess { die longmess @_ }
36 sub carp { warn shortmess @_ }
37 sub cluck { warn longmess @_ }