in reply to error/warn customization

JavaFan is right, as that is exactly what the __WARN__ and __DIE__ handlers are intended for:
use strict; use warnings; # Customize Warning messages. BEGIN { $SIG{'__WARN__'} = sub { warn localtime . ': ' . $_[0] }; $SIG{'__DIE__'} = sub { die localtime . ': ' . $_[0] }; } my $foo = 10; my $foo = 20; # warning about duplicate my $foo, die "Goodbye world";