[svn:perlfaq] r10481 - perlfaq/trunk
[email protected] Sun, 6 Jan 2008 11:05:28 -0800 (PST)
| Newsgroups | perl.cvs.perlfaq |
|---|---|
| Message-ID | <[email protected]> |
Author: comdog
Date: Sun Jan 6 11:05:28 2008
New Revision: 10481
Modified:
perlfaq/trunk/perlfaq4.pod
Log:
* perlfaq4: How do I sort a hash (optionally by value instead of key)?
+ I needed $hash{$key}, not $hash{$value}
Modified: perlfaq/trunk/perlfaq4.pod
==============================================================================
--- perlfaq/trunk/perlfaq4.pod (original)
+++ perlfaq/trunk/perlfaq4.pod Sun Jan 6 11:05:28 2008
@@ -1947,7 +1947,7 @@
foreach my $key ( @keys )
{
- printf "%-20s %6d\n", $key, $hash{$value};
+ printf "%-20s %6d\n", $key, $hash{$key};
}
We could get more fancy in the C<sort()> block though. Instead of