I've written a simple C program, that filters the
output of the "man" unix program, to make readable text
out of it. It works like this: man perl | man2txt > perl.txt

What would be the best way to code this in Perl?
Could anyone "translate" the following code in a native
Perl idiom for me?

<<
/**** man2txt.c *****/
#include <stdio.h>

int main (void) {

    char prev = 0, cur = 0 ;

    cur = getchar () ;
    while (!feof (stdin)) {
        if (cur == 8) {
            cur = 0 ;
        } else if (prev != 0) {
            putchar (prev) ;
        }
        prev = cur ;
        cur = getchar () ;
    }
    return 0 ;
}
>>

Thanks!


 Groeten,
 Irwin Oppenheim
 [EMAIL PROTECTED]
 ~~~*

 Chazzanut Online:
 http://www.joods.nl/~chazzanut/

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

Reply via email to