in reply to Re: Spotting an empty array as argument
in thread Spotting an empty array as argument
Right, I suspected there might not be any nice way of doing it. I mean, "say" does seem to do some magic in the "no argument" case, just like "print", since it treats it differently from the "empty array" case. But maybe that's just a special rule for built-in functions.
It's weird though, because there are so many built-in functions that have the same behaviour, defaulting to $_ if there are no arguments, and it's clearly useful, so it's surprising if there's no way of recreating that for your own functions.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Spotting an empty array as argument
by choroba (Cardinal) on Mar 25, 2021 at 21:39 UTC | |
by ikegami (Patriarch) on Mar 26, 2021 at 19:32 UTC | |
by LanX (Saint) on Mar 26, 2021 at 20:36 UTC | |
by ikegami (Patriarch) on Mar 27, 2021 at 05:56 UTC | |
by LanX (Saint) on Mar 26, 2021 at 10:46 UTC |