my $count3="-1"; foreach my $lane (@array) { if ($lane eq "--\n"){$count3++;print "\t" x $count3 . "0\n";} else {print "\t" x $count3 . "$lane"} }