Re: [EXIM] OFF TOPIC: exim -bh in perl

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: John Horne
Fecha:  
A: Nigel Metheringham
Cc: exim-users
Asunto: Re: [EXIM] OFF TOPIC: exim -bh in perl
On 02-Jul-98 at 12:17:54 Nigel Metheringham wrote:
> You can't pipe at both ends in perl - at least not without serious pain.
>

Oh yes...*serious* pain :-)

> You may be able to do this by using IO::Pipe to set up a pair of pipes,
> fork() and attaching the pipes to stdin/stdout of the subprocess, exec-ing
> exim, and talking to the pipes in the parent process - you probably need
> IO::Select to make sure you don't get yourself knotted.
>
> The easy solution is more likely to be:-
>
>     open (CMD, "| exim -d0 -bh $ipaddr 2>&1 >/tmp/filespec");
>     print CMD "various SMTP bits"
>     close CMD;
>     open (CMDRES, "</tmp/filespec");
>     (read and process earlier command output)

>

Yes, I think this is what I am going to end up with simply for simplicity.
I tried using 'pipe' but, as far as I remember, it just returned to the
command prompt. I may or may not have executed anything!

> This would be pretty easy to do in expect....
> I don't know of a decent easily available perl expect module yet.
>

Well from the full 5.002 manual I gathered that chat2 was to supercede
comm.pl. But it seems that inbetween that, comm.pl was 'upgraded' to include
functions enabling processing like 'expect'. I have to be careful here since
I don't use expect, so I don't know for sure what is and isn't possible with
comm.pl. The CPAN at the perl home site doesn't show comm.pl, at least
I couldn't find it (but got it from another archive), but does show chat2. It
looks to me like things have gone backwards in this respect!

Anyway, thanks for the info; back to the battle...

John.

-----------------------------------------------------------------------------
John Horne                                     E-mail: J.Horne@???
Academic and Information Services              Phone :  +44 (0) 1752 - 233911
University of Plymouth, UK                     Fax   :  +44 (0) 1752 - 233919



--
*** Exim information can be found at http://www.exim.org/ ***