in reply to Re^2: Why doesn't Perl provide %_ as the hash equivalent of @_ in subs? (ugly++)
in thread Why doesn't Perl provide %_ as the hash equivalent of @_ in subs?
Why not apply the same principle to %_?
Because $_ costs (almost) nothing to provide; so people not using it do not pay a penalty for those that do.
Setting up a hash from an arbitrary list of value would require substantial extra validation to see if doing so made any sense -- are there an even number; does the first of each pair make sense as a key etc. -- then building the hash and aliasing the hash values to the input arguments etc.
That is a substantial penalty for everyone who doesn't used that hash to pay, for the convenience of the few that would.
If you want that facility, do it yourself, cos I have no use for it and I don't want to pay the penalty.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Why doesn't Perl provide %_ as the hash equivalent of @_ in subs? (ugly++)
by smls (Friar) on Sep 27, 2013 at 10:15 UTC | |
by hdb (Monsignor) on Sep 27, 2013 at 10:29 UTC | |
by tobyink (Canon) on Sep 28, 2013 at 07:13 UTC | |
by BrowserUk (Patriarch) on Sep 27, 2013 at 10:53 UTC | |
by Anonymous Monk on Sep 28, 2013 at 06:12 UTC | |
by BrowserUk (Patriarch) on Sep 28, 2013 at 07:02 UTC |