[ale] Stripping out crap characters in perl

Christopher Fowler cfowler at outpostsentinel.com
Wed Sep 7 11:03:05 EDT 2005


I have written this program that interfaces with a modem and reads data
from a remote device.  The remote device dials in and dumps stuff out. 
As you know with modems that sometimes garbage is seen on connect and
disconnect.  I store all my data in a variable "$buffer". Is there a
function in perl that can go through an delete all those bad characters
from the normal ones that can be written to a file and read by any text
editor.  isprint() from ctype is not good because it will strip '\r' and
'\n' and those are valid characters.  




More information about the Ale mailing list