use strict; use Carp qw(cluck); sub test_errors { cluck "First test message"; my $long = Carp::longmess("Second test message"); my $short = Carp::longmess("Third test message"); print STDERR $long; print STDERR $short; test2(); } sub test2 { cluck "Fourth test message"; my $long = Carp::longmess("Fifth test message"); my $short = Carp::longmess("Sixth test message"); print STDERR $long; print STDERR $short; } test_errors();