Hi
I have some C code that I need to convert to perl and I am pressed for time,
which is why I am posting this.  All the code does is read each character
from either STDIN or a file and replaces any ASCII control characters with a
space.

Is the perl getc() function the best way to look at one char at a time?

The C code looks like below. I have some ideas but I am not sure of the best
way to represent these char ranges in perl
--
  while ( !feof(fin) ) {
    ch=getc(fin);

    if ( (ch<=0176) && (ch>=040) || (ch=='\n') ) {
      putc( ch, stdout );
    } else {
      putc( ' ', stdout );
    }

  }

-----

Thanks for any suggestions
Jim


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to