You can trap any warn (or die) yourself like this:
use strict;
$SIG{__WARN__} = \&mywarn;
sub mywarn { print "here!\n @_\n"; }
{ test ('arf', undef, 'dog'); }
sub test {
@_ == 3 or die "Incorrect number of arguments";
my ($a, $b, $c) = @_;
my %hash = ('arf' => {'spot' => {'dog' => 3}});
print $hash {$a}->{$b}->{$c};
}
...which prints this output:
here!
Use of uninitialized value in hash element at test.txt line 23.
here!
Use of uninitialized value in hash element at test.txt line 23.
here!
Use of uninitialized value in print at test.txt line 23.
Hope that helps,
Shendal