in reply to trap run time errors

Typically, you would also know the line number where the error occurs. "Use of uninitialized value in concatenation . . ." would mean that one of the variables in that line is uninitialized. So why not just adding a print statement like

print STDERR "|\$var1=$var1|\$var2=$var2|\n" unless defined $var1 and +defined $var2;