$errfile = qw( stderr.log ); open STDERR, ">$errfile"; die "And in that sleep of death, who knows what dreams may come..."; #### #!\usr\bin\perl my @errors = (); my $ctr = 0; for ( $ctr = 0; $ctr < 10; $ctr += 1 ) { eval { if ( $ctr == 5 ) { die "Number 5 is not alive."; } }; if ( $@ ) { push ( @errors, $@ ); } } $ctr = @errors; if ( $ctr != 0 ) { for ( @errors ) { print "$_\n"; } } else { print "No errors found."; }