in reply to File Writing and newline

My guess is that you have some combination of multiple carriage return and/or newline at (or before) the end of one or more of your variables (although I suspect $report_category_name2). Instead of chomping anything, try:
$string_to_print =~ s/\r|\n//g;
and then print the string. This worked in my tests but then I stink at regexen, so, if this is not the best (correct) way to do it I'd like to know for future reference. BTW, if I were you I'd also pinpoint the offending data source, especially if it is used by other programs.

--Jim