in reply to uninitialized variables
For example, I'm assuming your code looks something like this currently:
If you initialize your variables with non-undef's first, you'll avoid the "not defined" warnings:my ($this, $that, $other) = split (/\s+/, $line); # $line might have < 3 elements in it, the rest will be undef
Alanmy ($this, $that, $other) = ("") x 3; ($this, $that, $other) = split (/\s+/, $line); # Now the worst case is you'll have a null string, not undef
|
|---|