in reply to Re: Use of uninitialized value in string
in thread Use of uninitialized value in string
I've got my sources! I'm committed!
To the op: use Data::Dumper, and print out what's in the dubious variables (here: $arg). If this sub is called a lot without any warnings, then it's better to restrict output to when it is actually useful. For that, I sometimes do things like:
You must put that where $arg is in scope, thus in the sub, and it needs to be run before the warning happens.use Data::Dumper; local $SIG{__WARN__} = sub { print STDERR @_, Dumper $arg };
Also, print out the line number perl thinks it's on, it's in __LINE__. Sometimes it's off from the actual line number by 1, maybe sometimes even more (though I don't think I've ever seen that happen).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Use of uninitialized value in string
by tadman (Prior) on Aug 22, 2002 at 22:47 UTC |