in reply to How do I remove carriage returns from scalars?

$textfield =~ s/\n//g;

See perlfunc:s.