Help for this page

Select Code to Download


  1. or download this
    my $ar = [ [ 'HEAD_goes_here', 'BODY_here' ],
               [ 'FOOT', 'FOOT', 'FOOT', 'FOOT' ]
    ];
    
  2. or download this
     my $scalars_flattened = [ \$ar->[0][0], \$ar->[0][1],
         \$ar->[1][0], \$ar->[1][1], \$ar->[1][2], \$ar->[1][3] ];
    
  3. or download this
     my @flat = @{$_[0]};
     while ( List::Util::any { 'ARRAY' eq ref $_ } @flat ) {
            @flat = map { 'ARRAY' eq ref $_ ? \(@$_) : \$_ } @flat;
            @flat = map { 'REF' eq ref $_   ? $$_    : $_ } @flat;
     }
    
  4. or download this
     $ar = [ 'HEAD', 'BODY', [ 'FOOT', 'FOOT', 'FOOT', 'FOOT'], ];