in reply to Re: Getting Rid of Newlines Between Strings
in thread Getting Rid of Newlines Between Strings

Just a thought; to cover the possibility of a humanly blank line which happens to contain whitespace, it could be further modified:
if ($cg =~ /^\s*$|NA/) {