my $rownew = 0; foreach my $box ( @boxes ) { if ( $rownew ? 1 : $rownew++ ) { print( "," ); } print( $box ); }