That's a clever way of doing it. Of course its only useful if the subroutine you are writing is expecting exactly 0 or 1 argument.
If the subroutine allows multiple arguments with only some being optional, the above approach will not work.
In reply to Re: Explicitly check for argument presence...
by ehdonhon
in thread Default subroutine parameters
by thelenm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |