in reply to Use of uninitialized value in hash element, -w, How to get details

You can't. It says which line the problem is in, and in this case, it even specifies it's in the concatenation. (String interpolation is a form of concatenation.)

You can debug it real quick as follows:

#!/usr/bin/perl -w use strict; use Carp; my $foo; my $fum="testing"; "$fum" && 0; "$foo" && 0; print "$fum $foo\n";

If the data is allowed to be undefined, you can used defined to check if it and sanitize it.

#!/usr/bin/perl -w use strict; use Carp; my $foo; my $fum="testing"; my $f_foo = defined $foo ? $foo : ''; my $f_fum = defined $fum ? $fum : ''; print "$f_fum $f_foo\n";

("f_" for "formatted")

Replies are listed 'Best First'.
Re^2: Use of uninitialized value in hash element, -w, How to get details
by brycen (Monk) on Aug 15, 2006 at 03:21 UTC
    When I don't care, I prefer using:
    { no warnings 'uninitialized'; print "$fum $foo\n"; }
    But sometimes I want to track down the real cause. I'm at v5.8.7... I wonder how long until SUSE picks up perl 5.10 with the improvement?