in reply to Re^2: How can I populate a hash?
in thread How can I populate a hash?

Hmm. It occurs to me that if the goal's to do it in a single statement, it can be done quite easily:

#!/usr/bin/perl use strict; use warnings; my @k = qw( a b c a b a ); my %i = do { my %h; map { $_ => ++$h{$_} } @k }; print join " ", %i;

That's cheating of course, but so is tie. :-)

Makeshifts last the longest.