If no return is found and if the last statement is an expression, its value is returned. If the last statement is a loop control structure like a foreach or a while , the returned value is unspecified.
Since you have a while loop as the last statement, the returned value is undefined.
UPDATE: Perl : Convert a monolithic code to a function
In reply to Re: Perl function calls.
by toolic
in thread Perl function calls.
by user786
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |