I'm getting counter intuitive results
From the docs of to Carp#$Carp::Verbose
This variable makes carp() and croak() generate stack backtraces just like cluck() and confess(). This is how use Carp "verbose" is implemented internally.
Defaults to 0.
my results show no difference...
What am I missing?
here my code
use strict; use warnings; use Carp; #use Data::Dumper; sub out {warn @_,"\n" } out "Perl-Version $] $^OS"; out '====== default $Carp::Verbose =',$Carp::Verbose; my $err_msg = "Fehlermeldung"; sub throw0 { my ($type) = @_; out "=== Testing $type"; eval { goto $type } or die "Testcase '$type' not implemented"; croak: croak $err_msg; die: die $err_msg; confess: confess $err_msg; } sub throw1 { throw0(@_) } sub throw2 { throw1(@_) } for my $verbose ( undef,0,1 ){ if (defined $verbose) { $Carp::Verbose = $verbose; out "====== Setting Verbose to $verbose"; } # --- types of dieing for my $type (qw/die croak confess/){ eval { throw2($type) } or out $@; } } #done_testing();
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
I think I found the issue
In reply to $Carp::Verbose ? (SOLVED) by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |