in reply to Re: printing hashes
in thread printing hashes
I'm surprised you didn't propose this variant of your earlier post today:
...or any other of the other join alternation schemes.use List::Util 'reduce'; my %hash = ( foo => 1, bar => 2, baz => 3 ); my $count = 0; print +( reduce {$a . (++$count % 2 ? ' => ' : ', ') . $b} %hash ), $/; __END__ bar => 2, baz => 3, foo => 1
the lowliest monk
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: printing hashes
by Roy Johnson (Monsignor) on May 06, 2005 at 02:53 UTC |