in reply to Re: sub returning undef
in thread sub returning undef
sub never return arrays. They return lists.
A sub never returns an array _directly_, but it can return arrays by reference, along with anything else it wants to return, in its list of return values.
The OP may have meant that the sub returns a list of whatevers, or he might have meant that it returns an array reference. It's hard to be certain since he only gave us a possibly-misleading comment for that case and focused on the error case where he returns undef. My guess is, he hasn't _written_ the non-error case yet and hasn't put a lot of thought into how it returns, but that's only a guess.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: sub returning undef
by Abigail-II (Bishop) on May 24, 2004 at 16:10 UTC |