P07 - Flatten a nested array structure.

Author: Orginally Ryan Connelly

Example

> my @a = 1, 2, [3, 4], 5;
> say @a.flat.list.perl
(1, 2, 3, 4, 5)

Source code: P07-topo.pl

use v6;

my @a := 1, 2, [3, 4], 5;

say @a.perl;
say 'Flattened:';
say @a.flat.list.perl;