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.
In reply to Re: sub returning undef
by BrowserUk
in thread sub returning undef
by Scarborough
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |