in reply to Re^3: resetting a foreach loop!
in thread resetting a foreach loop!
Technically, the no-explicit-return version of the function returns 0 for an empty argument list
I am aware of that, but they are relying undefined behaviour to do so[1], and it's a poor value to return.
I infer that the OP did the if(@_) just to prevent divide-by-zero.
That would actually have been a far better outcome!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: resetting a foreach loop!
by AnomalousMonk (Archbishop) on Nov 17, 2017 at 20:15 UTC | |
by ikegami (Patriarch) on Nov 18, 2017 at 00:07 UTC | |
by AnomalousMonk (Archbishop) on Nov 18, 2017 at 00:43 UTC | |
by pryrt (Abbot) on Nov 18, 2017 at 02:11 UTC | |
by AnomalousMonk (Archbishop) on Nov 18, 2017 at 20:26 UTC |