Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!snorkelwacker.mit.edu!thunder.mcrcim.mcgill.edu!clyde.concordia.ca!daily-planet.concordia.ca!bonnie.concordia.ca!s3!regie From: regie@ireq-robot.hydro.qc.ca (Regis Houde) Newsgroups: comp.lang.perl Subject: Intercepting the Mail output with a Perl program Message-ID: <6819@s3.ireq.hydro.qc.ca> Date: 6 May 91 19:55:07 GMT Sender: usenet@s3.ireq.hydro.qc.ca Organization: Laboratoire de robotique, Institut de recherche d'Hydro-Quebec Lines: 31 I wrote a program that intercepts the output of the standard /usr/ucb/Mail program in order to interpret and replace a set of characters. I'd like the program to behave exactly like the original one so a program calling it (as mailtool) won't make any difference. Here is my program : #!/usr/bin/perl # Name : Mail # Usage : Mail # Make the stdio unbuffered select((select(stdout), $| = 1)[0]); select((select(stdin), $| = 1)[0]); open(IN,"/usr/ucb/mail @ARGV |"); while() { # Some simple code here print ; } It does pretty well except for the prompt that doesn't come at the right time and this seems to bug mailtool when a user press the delete button. Any idea? Thanks