more useful options | |
PerlMonks |
Re^4: What is the difference between |= and ||=?by Anonymous Monk |
on Apr 08, 2009 at 04:51 UTC ( [id://756225]=note: print w/replies, xml ) | Need Help?? |
It's undef because the hash reference is a value returned from an SQL query. If no rows are selected (for instance), then it's possible for the 'id' value to be undef. And when I perform some math operation (as noted by Marshall below), the warning is triggered. I could wrap the math operation code around a conditional to suppress the warning: But I'm not sure if that's better than using ||=.
In Section
Seekers of Perl Wisdom
|
|