in reply to Breaking out of undef/null database reads
undef is a state, not a string. Change 'undef' to undef.
ne is a string operator. You can use either == to check if the value is false (which undef is), or better yet, use the defined() function within a for() loop.
This will skip each undefined element, and continue:
for (@MyData){ next if ! defined; ... }
This will break out of the loop entirely when it hits the first undef:
for (@MyData){ last if ! defined; ... }
|
|---|