in reply to Pushing Arrays into Hash without nesting
my guess is that here in your last sub addSomeNumbersFromSource
>
you rather need to flatten the array-ref to a list before assigning it to another array.
my @array = @{ $source{$data} } ; return @array;
otherwise @array = ( [ ... the-source-data ... ] ) has just one array-ref. (aka a "nested array" in your words)
whenever you have something like
@array = $scalar
that'll result into a one-element array.
... and $source{$data} is certainly a scalar, presumably holding an array-ref.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Pushing Arrays into Hash without nesting
by treeshark (Initiate) on Feb 14, 2021 at 15:29 UTC |