Here are a couple more alternatives...
sub ReadSource{ my ($DataSource, $HashRef) = @_; my @Data = get_data(); for (@Data){ my $item = $HashRef->{$_} ||= []; push( @$item, $DataSource ); } }
..or..
sub ReadSource{ my ($DataSource, $HashRef) = @_; my @Data = get_data(); push( @{ $HashRef->{$_} ||= [] }, $DataSource ) for @Data; }
There really is more than one way to do it!

In reply to Re: Complex Data Structure Suggestions Wanted by djohnston
in thread Complex Data Structure Suggestions Wanted by Ninthwave

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":