in reply to Spotting an empty array as argument
You can't pass arrays (or hashes) to subs, only a sequence of zero or more scalars. There is no difference between
andf(@a)
f($a[0], $a[1], $a[2], ...)
so you can't distinguish
frommy @empty; f(@empty)
f()
At best, you can use prototypes to change what scalars are passed to a sub.
will allowsub f(;\@)
andf(@a) # Calls &f(\@a)
but notf() # Calls &f()
f($x, $y)
What you want to achieve, however, can't be achieved using prototypes. You'd have to use something like Devel::CallParser.
Seeking work! You can reach me at ikegami@adaelis.com
|
|---|