in reply to if ($2) behaves differently than if (defined $2)
From perldoc -f defined:
' Note: Many folks tend to overuse "defined", and then are surprised to discover that the number 0 and "" (the zero-length string) are, in fact, defined values.'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: if ($2) behaves differently than if (defined $2)
by radiantmatrix (Parson) on Apr 15, 2008 at 18:09 UTC | |
by repellent (Priest) on Apr 16, 2008 at 16:57 UTC |