-*- mode: compilation; default-directory: "d:/tmp/job/" -*- Compilation started at Thu Sep 30 17:33:06 C:/Strawberry/perl/bin\perl.exe -w d:/tmp/job/test_carp.pl Perl-Version 5.032001 MSWin32S ====== default $Carp::Verbose =$VAR1 = 0; ====== Setting Verbose to 0 === Testing die Fehlermeldung at d:/tmp/job/test_carp.pl line 27. === Testing croak Fehlermeldung at (eval 6) line 4. === Testing confess Fehlermeldung at d:/tmp/job/test_carp.pl line 29. SAME::throw0("confess") called at d:/tmp/job/test_carp.pl line 34 SAME::throw1("confess") called at d:/tmp/job/test_carp.pl line 38 SAME::throw2("confess") called at (eval 7) line 4 OTHER::client0("confess") called at (eval 7) line 7 OTHER::client1("confess") called at (eval 7) line 9 eval ' package OTHER; use Data::Dumper; sub client0 { SAME::throw2(@_); }; sub client1 { client0(@_); }; client1("confess"); ' called at d:/tmp/job/test_carp.pl line 53 ====== Setting Verbose to 1 === Testing die Fehlermeldung at d:/tmp/job/test_carp.pl line 27. === Testing croak Fehlermeldung at d:/tmp/job/test_carp.pl line 25. SAME::throw0("croak") called at d:/tmp/job/test_carp.pl line 34 SAME::throw1("croak") called at d:/tmp/job/test_carp.pl line 38 SAME::throw2("croak") called at (eval 9) line 4 OTHER::client0("croak") called at (eval 9) line 7 OTHER::client1("croak") called at (eval 9) line 9 eval ' package OTHER; use Data::Dumper; sub client0 { SAME::throw2(@_); }; sub client1 { client0(@_); }; client1("croak"); ' called at d:/tmp/job/test_carp.pl line 53 === Testing confess Fehlermeldung at d:/tmp/job/test_carp.pl line 29. SAME::throw0("confess") called at d:/tmp/job/test_carp.pl line 34 SAME::throw1("confess") called at d:/tmp/job/test_carp.pl line 38 SAME::throw2("confess") called at (eval 10) line 4 OTHER::client0("confess") called at (eval 10) line 7 OTHER::client1("confess") called at (eval 10) line 9 eval ' package OTHER; use Data::Dumper; sub client0 { SAME::throw2(@_); }; sub client1 { client0(@_); }; client1("confess"); ' called at d:/tmp/job/test_carp.pl line 53 Compilation finished at Thu Sep 30 17:33:06 #### use strict; use warnings; package SAME; use Carp; use Data::Dumper; sub out {warn @_,"\n" } out "Perl-Version $] $^OS"; out '====== default $Carp::Verbose =', Dumper $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(@_) } my $PACKAGE="OTHER"; for my $verbose ( 0,1 ) { if (defined $verbose) { $Carp::Verbose = $verbose; out "====== Setting Verbose to $verbose"; } no warnings 'redefine'; # --- types of dieing for my $type (qw/die croak confess/) { eval <<"__CODE__" or out $@; package $PACKAGE; use Data::Dumper; sub client0 { SAME::throw2(\@_); }; sub client1 { client0(\@_); }; client1("$type"); __CODE__ } }