in reply to Initialization of hash element....

Yes, undef gets treated as 0. Actually you can use += to make it even more succinct:

$myhash{$key} += 1;

DWIM is Perl's answer to Gödel

Replies are listed 'Best First'.
Re^2: Initialization of hash element....
by blazar (Canon) on Jun 01, 2007 at 11:51 UTC