Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re^3: Better way of doing!

by kcott (Archbishop)
on Aug 21, 2013 at 10:26 UTC ( [id://1050321] : note . print w/replies, xml ) Need Help??

in reply to Re^2: Better way of doing!
in thread Better way of doing!

If you want to initialise all counts to zero, do this:

my %count = map { $_ => 0 } @keywords;

Also, see my update: that's probably a better choice of code for your application.

-- Ken