in reply to sub returning undef
Have your sub return the empty list return (); or even (someways better) just return; for the error case. Then your array will be empty.
undef is a value. For example, my @array = (undef) x 5; print scalar @array; will print 5.
|
|---|