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 |