On Mon, Aug 21, 2000 at 09:00:26PM -0400, Casey R. Tweten wrote: > Today around 3:34pm, Tom Christiansen hammered out this masterpiece: > : No. keys() expects something that starts with a %, not > : something that starts with a &. > > 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? It cares because it is only defined to operate on hashes. A list is not a hash. > All functions recieve their arguments in a LIST via @_. Since &func, in the > above example, returns a LIST, that LIST should just be passed on. Exactly. This is what happens. keys() doesn't operate on lists. > keys( @array ); So this would "convert" @array to a hash and take the keys of that? Or does it (as some have proposed) return the keyable indices of sparse array? > Otherwise, work something like this: > > sub keys { > my %hash = @_; > return keys %hash; > } Ah, convert is argument to a hash then grab the keys of that hash. -Scott -- Jonathan Scott Duff [EMAIL PROTECTED]
- 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
- Re: functions that deal with hash should be m... Tom Christiansen