my $string = "hi, \n\nhow are you\n?"; $string =~ tr/\n/X/; print ">>$string<<\n";