in reply to Re: Choosing the right datastructure
in thread Choosing the right datastructure

Thanks.
My initial confusion came from thinking that:
my %source; my %action; my ($source, $action) = qw(test_source test_action); $source{$source} = { $action{$action}++ }; $source{$source} = { $action{$action}++ };
would give me a hash called %source with each key having a value of the hash "%action", with it's keys and values.
It output:
$VAR1 = 'test_source';
$VAR2 = {
          '1' => undef
        };
$VAR1 = 'test_action';
$VAR2 = '2';

where I was looking for:
$VAR1 = 'test_source';
$VAR2 = {
          'test_action' => 2
        };
It makes Perl-fect sense, though, that it would set the value of $source{$action} to true, while setting the keys and values of %action_hash.

Thanks for helping me grok this.
  dug