Nope, the while loop condition exits on empty lists and your code doesn't do the same thing.
Try returning an empty array ref [].
see also Re: Unconventional exit from while loop
Cheers Rolf
( addicted to the Perl Programming Language)
In reply to Re^3: Unconventional exit from while loop
by LanX
in thread Unconventional exit from while loop
by hdb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |