use MyLittlePlace::BrandNewMod qw(a b c); close STDERR; open(STDERR, ">&STDOUT") || die " uh uh ?! we mad ?! "; $|++; #### close STDERR; # no more redirect of handler # open(STDERR, ">&STDOUT") || die " uh uh ?! we mad ?! "; $|++; my $err_count = 0; $SIG{__WARN__} = sub { ++$err_count;print STDOUT @_ }; $SIG{__DIE__} = sub { ++$err_count;print STDOUT @_ }; #do all the stuff and at the end.. &advise_me($content) if $err_count > =; print $err_count, " ERROR",($err_count eq 1 ? '' : 'S' ), " IN $0\n";