in reply to Re^2: Is silent use of $_ for empty argument lists reasonable for "shortcut" functions? (E2CUTE)
in thread Is silent use of $_ for empty argument lists reasonable for "shortcut" functions?
I wish / ... / that there was some other way to detect no arguments without forcing the 1st argument into a reference.
There is, kind of.
This will make $_[0] become aliased with $_ if foo was called with &foo and without the parenthesis. Personally I wouldn't use this. It will only lead to trouble.sub foo { (caller(0))[4] or return foo($_); ...; }
lodin
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Is silent use of $_ for empty argument lists reasonable for "shortcut" functions? (E2CUTE) (&foo;)
by Wyrdweaver (Beadle) on Aug 26, 2007 at 18:00 UTC |