while (...){ print",\n" unless $should_not_print++; # munging ... }