Search   Feed   Browse   Add
Feed items 1 - 2 of 2 for January 2008

Re: How do I sort a hash (optionally by value instead of key) by brian d foy - January 6, 2008

This message was both posted and mailed: see the "To," "Cc," and "Newsgroups" headers for details. In article <20080105162917.GA79568genre121.com>, Mark<markgenre121.com> wrote:> printf "%-20s %6dn", $key, $hash$value;> > > Shouldn&39;t that be $hash$key Indeed it should. I&39;ve fixed that in revision 10481.Thanks,
http://www.nntp.perl.org/group/perl.perlfaq.workers/2008/01/msg608.html

How do I sort a hash (optionally by value instead of key) by Mark - January 5, 2008

The following is given in the FAQ on how to sort a hash... my keys = sort $a cmp $b keys %hash; foreach my $key ( keys ) printf "%-20s %6dn", $key, $hash$value; Shouldn&39;t that be $hash$key Also, I think it would be better to use K&R bracketing insteadof GNU bracketing.Thanks for listening.- Mark
http://www.nntp.perl.org/group/perl.perlfaq.workers/2008/01/msg607.html
Available Archives
- January (2 items)
- March (1 item)
- June (15 items)
Sponsored Links
© 2008 FeedCapsule.com  |  Contact