in reply to Re: Re: print not behaving as expected
in thread print not behaving as expected

You ought to change it to:
$response =~ tr/\n\r//d;
tr/// is for translating/stripping characters. Save s/// for real regexes :-)