Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!uunet!tut.cis.ohio-state.edu!ucbvax!iwarp.intel.com!news From: merlyn@iwarp.intel.com (Randal L. Schwartz) Newsgroups: comp.lang.perl Subject: Re: Intercepting the Mail output with a Perl program Message-ID: <1991May8.162857.9881@iwarp.intel.com> Date: 8 May 91 16:28:57 GMT References: <6819@s3.ireq.hydro.qc.ca> Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal L. Schwartz) Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 35 In-Reply-To: regie@ireq-robot.hydro.qc.ca (Regis Houde) In article <6819@s3.ireq.hydro.qc.ca>, regie@ireq-robot (Regis Houde) writes: | | 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 : [program that opens Mail on a stdout pipe deleted] | 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? If I remember correctly, /usr/ucb/Mail does different things depending on whether it is run from a tty or not. Since you are opening the program with stdout attached to a pipe rather than a tty, I bet Mail is getting confused. You'll need to run Mail inside a pty. There have been a few packages floating through here in the last few months (chat2.pl included) that'd do that for you. (I think that's the problem. If someone else has more info, please chime in. I haven't touched Mail in years.) print substr("Just another Perl hacker, or something like that...", 0, 25) -- /=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\ | on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III | | merlyn@iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn | \=Cute Quote: "Intel: putting the 'backward' in 'backward compatible'..."====/