⭐ in reply to How do I remove control characters?
tr/// is better but all you needed to make your pseudocode real perl code was:
s/[^\040-\176]/ /g
Note that the control chars are \000 - \037 so these are perhaps more direct:
tr/\000-\037/ /; # best option for speed s/[\000-\037]/ /g # but this still works
Note chr 32 dec 040 octal is the space so you were double spacing your spaces by starting at \041
|
|---|