Perl usually complains about a line with an actual error, for example. when a variable is used only once:
use warnings; if ( 0 ) { } elsif ( $test ) { } # line 3 # Name "main::test" used only once: possible typo at testt.pl line 3.
This does not work for warnings about using uninitialized $_ :
use warnings; if ( 0 ) { # line 2 } elsif ( chomp ) { } # Use of uninitialized value $_ in scalar chomp at testt.pl line 2. use warnings; if ( 0 ) { # line 2 } elsif ( m/test/ ) { } # Use of uninitialized value $_ in pattern match (m
What causes this? When will this behavior be useful?
source share