in reply to Converting array reference to list context
First, "$arr_ref_new = ( [1],[2],[3,4] );" can't possibly be what you want. You construct three arrays then proceed to discard two. (Why didn't you ask why you were getting "in void context" warnings?) So you're not clear on the inputs to your problem.
Second, you're not very clear on what output you want either.
I think you want:
my $aoa = [ [1],[2],[3,4] ]; my @flat = map { @$_ } @$aoa; # @flat = (1,2,3,4)
Update: Fixed variable name mismatch.
|
|---|