http://qs321.pair.com?node_id=11128372


in reply to Pushing Arrays into Hash without nesting

You do have a problem with 'list', but not in the way that you think. The first sentence of the DESCRIPTION section of the documentation for Data::Dumper is:
Given a list of scalars or reference variables, writes out their contents in perl syntax.

In your first call to Dumper, you specified '%hash', clearly a hash, not a scalar or a reference variable. In list context, perl converts this to a list of alternating keys and values. In your case, there is only one of each. They are dumped as '$VAR1' and '$VAR2'. By convention, you should specify a reference to your hash Dumper \%hash. There is a similar problem with all your other dumps. Correctly formed dumps would have helped you spot the problem ($source{$data} in addSomeNumbersFromSource contains a reference to an array, not an array). A simple fix is to dereference it before assigning to '@array'.

#my @array = $source{$data} ; my @array = @{$source{$data}} ;
Bill