foreach my $i ( 2 .. $#shapes ) { print $out_ph1 '$_' for @{$i}[ 2 .. $#$i]; print $out_ph1 ''\n"; }