laziness, impatience, and hubris | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
all your code examples are broken (multiply) and don't compile.
At the same time you claim the output is factual. Please don't do this!!! Point is that keys' prototype expects one %hash or @array not a scalar. And the argument must start with % or @
The point you should make is that there has to be exactly ONE argument! That's why keys can't expect a LIST. and this can't be changed with a new feature, because otherwise old code would break. Consider @all_keys = keys %h1, keys %h2; which will parse like @all_keys = keys(%h1), keys(%h2); and collect the keys from %h1 and %h2
Now, if keys LIST was allowed, than the first keys would try to consume the rest of the list. @all_keys = keys( %h1, keys(%h2) ); That's why the idea of the OP can't be implemented, without breaking backwards compatibility!
Cheers Rolf In reply to Re^10: Using 'keys' on a list (prototype & backwards compatibility)
by LanX
|
|