Unfortunally, it's not a general technique. It works here because 'fib(0)' is supposed to return '0'; the block isn't executed if the argument of the function is 0.But it can be written as:
and then it will always do the 'do'.local our ($n, $m) = (shift, 0)) && do { }
In reply to Re^4: Programming in Perl without semicolon
by JavaFan
in thread Programming in Perl without semicolon
by buetow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |