http://www.perlmonks.org?node_id=608235


in reply to Debugging "Use of uninitialized value" warnings.

This is not currently possible. However, the development version of perl (from 5.9.2 onwards) attempts to determine which variable was undefined; it can't always, as this example shows:

use strict; use warnings; my %foo; my %bar; $bar{'one'} = 1; my ($x,$y); $x = "$bar{'one'} $foo{'one'}"; $x = "$y $foo{'one'}"; $x = "xxx $foo{'one'}"; __END__ Use of uninitialized value in concatenation (.) or string at /tmp/p li +ne 10. Use of uninitialized value $y in concatenation (.) or string at /tmp/p + line 11. Use of uninitialized value in concatenation (.) or string at /tmp/p li +ne 11. Use of uninitialized value $foo{"one"} in concatenation (.) or string +at /tmp/p line 12.
Dave.