Re: sort() on specific key in each hashref of a hash of hashrefs

2004-07-22 Thread JupiterHost.Net
Jeff 'japhy' Pinyan wrote: On Jul 22, JupiterHost.Net said: my %data = ( 'foo' => { sorton => 2, data => 'blah' }, 'bar' => { sorton => 1, data => 'yike' }, 'baz' => { sorton => 3, data => 'zipp' }, ); I'd like to sort them on the sorton key so it is: sort { $data{$a}{sorton} <=> $data{$

Re: sort() on specific key in each hashref of a hash of hashrefs

2004-07-22 Thread JupiterHost.Net
JupiterHost.Net wrote: Hello, Long week and brain is off :) I have a hash like so: my %data = ( 'foo' => { sorton => 2, data => 'blah' }, 'bar' => { sorton => 1, data => 'yike' }, 'baz' => { sorton => 3, data => 'zipp' }, ); for(sort %data) { print ${ $data{$_} }{data},"\n"; } Ok, I thi

Re: sort() on specific key in each hashref of a hash of hashrefs

2004-07-22 Thread Jeff 'japhy' Pinyan
On Jul 22, JupiterHost.Net said: >my %data = ( >'foo' => { sorton => 2, data => 'blah' }, >'bar' => { sorton => 1, data => 'yike' }, >'baz' => { sorton => 3, data => 'zipp' }, >); > >I'd like to sort them on the sorton key so it is: sort { $data{$a}{sorton} <=> $data{$b}{sorton} } k

sort() on specific key in each hashref of a hash of hashrefs

2004-07-22 Thread JupiterHost.Net
Hello, Long week and brain is off :) I have a hash like so: my %data = ( 'foo' => { sorton => 2, data => 'blah' }, 'bar' => { sorton => 1, data => 'yike' }, 'baz' => { sorton => 3, data => 'zipp' }, ); for(sort %data) { print ${ $data{$_} }{data},"\n"; } output: yike zipp blah I'd like t