Casey R. Tweten writes: > Wow. Now that, that, is lame. You're saying that keys() expects > it's first argument to begin with a %? Why should it care what it's > argumen begins with? The keys function changes its arguments' data structure. keys resets the each iterator (see the documentation for these functions). > All functions recieve their arguments in a LIST via @_. The hash functions are prototyped as \%, meaning they are passed a reference to the hash named as an argument. The reference-taking: * permits them to change the data structures * is faster (one value, not all the key/value pairs) This isn't strictly needed for keys (if you don't mind it getting slower), but is needed for each() which maintains an iterator in the hash. There's also the fact that a list isn't a hash, the same way a list isn't an array. You are on a slippery slope that ends in: push( split(/,/), "foo" ); Because "push() just takes a list, right?" (hint: wrong). Nat
- functions that deal with hash should be more liberal Jerrad Pierce
- Re: functions that deal with hash should be more ... Tom Christiansen
- Re: functions that deal with hash should be m... Casey R. Tweten
- Re: functions that deal with hash should ... Tom Christiansen
- Re: functions that deal with hash sho... Casey R. Tweten
- Re: functions that deal with has... Tom Christiansen
- Re: functions that deal with... Casey R. Tweten
- Re: functions that deal with has... Nathan Torkington
- Re: functions that deal with... Chaim Frenkel
- Re: functions that deal with has... Jonathan Scott Duff
- Re: functions that deal with hash should ... John Porter
- Re: functions that deal with hash sho... Casey R. Tweten
- Re: functions that deal with hash should be more ... Jerrad Pierce
- Re: functions that deal with hash should be m... Tom Christiansen
- Re: functions that deal with hash should be more ... Jerrad Pierce
- Re: functions that deal with hash should be m... Tom Christiansen
- Re: functions that deal with hash should be m... John Porter
- Re: functions that deal with hash should be more ... Jerrad Pierce