in reply to Removing Line Breaks

If you only want to remove line breaks at the end of a variable, use
chomp $variable;
If you want to remove all line breaks, use
$variable =~ tr/\n//d;