What's the easiest way to flatten a multidimensional array ?
One level of flattening using map
$ref = [[1,2,3,4],[5,6,7,8]]; # AoA @a = map {@$_} @$ref; # flattens it print "@a"; # 1 2 3 4 5 6 7 8
2.1m questions
2.1m answers
60 comments
57.0k users