chomp(@array) will remove newlines from the end of each element within an array. If the newline is being placed at the start of the element you may need to preprocess the the code prior to the print. The '.' now matches newlines so you have to consider this when outputting code
If really problematic, please post a new thread with example code and output. You may mean the same row once printed out in html for all I can tell.