in reply to CR's and other control chars

[ PerlMonks Discussion is for discussions about PerlMonks. I moved your post to Seekers of Perl Wisdom ]

/[[:cntrl:]]/ is equivalent to /[^[:^cntrl:]]/, so

# Replace everything except non-controls, CR and LF. $msg =~ s/[^[:^cntrl:]\r\n]+/ /g;

The "s" modifier is useless since "." isn't being used.

Replies are listed 'Best First'.
Re^2: CR's and other control chars
by maqqaios (Initiate) on Apr 16, 2009 at 06:53 UTC
    Thank you.