Ang-st has asked for the wisdom of the Perl Monks concerning the following question:

dear monks,
i have a problem that i know might be conceptual :.
I want to retrieve data from another script according to the fact that the stdin is already occupied for another things.

i'll try to explain : i try to make a script for filtering mail and the way i try to use is registering senders into a database. So the mail queue would be piped to the script which extract the headers and compare it to the database. in case the senders is not registred the script would send a registration mail with a link to a cgi script ...
the problem is there .

what kind of solutions may solve it? I just expect few tips to look in the right direction (as you may notice i'm quite new in programmation )

thanks in advance for your advices/help

  • Comment on retrieve data from another script not from stdin

Replies are listed 'Best First'.
Re: retrieve data from another script not from stdin
by ysth (Canon) on Jan 17, 2005 at 22:47 UTC
    Perhaps start with perldoc perlipc (interprocess communication).
Re: retrieve data from another script not from stdin
by Errto (Vicar) on Jan 18, 2005 at 00:07 UTC
    If you want to send mail from Perl you have many choices, incuding Mail::Send and others. It really doesn't matter whether STDIN and STDOUT are available or not. If you really do need to pipe data to another process directly from your script, you might want to look at perlopentut.
Re: retrieve data from another script not from stdin
by g0n (Priest) on Jan 18, 2005 at 09:23 UTC
    A quick and dirty solution on *nix would be to use a FIFO - create a FIFO using mknod, open it as a > filehandle in one script and a read filehandle from the other. Inelegant but easy :-)