control vICQ via Perl
am 13.09.2007 12:23:26 von EricHi everyone,
I'm trying to write a rather simple Perl script to read output from
and write input to vICQ, a small ICQ console client. I know tat vICQ
itself is written in Perl, but I'm looking for a way to communicate
with other programs also, so I won't change vICQ's source.
The idea is to launch vICQ in my Perl script using IPC::start() and
then process its output (i.e. ICQ messages sent to this machine) in
intervals of, say, 30 seconds. Depending on this output I want to send
a message back to the other machine.
I read about doing this with pipes, but these don't seem to work for
me (see also http://www.thescripts.com/forum/thread49897.html), so
right now I'm using simple scalars as input/output buffers. The only
problem is that after a pump() new output (if available) is just
appended to my $out scalar. So how can I determine if there is new
output available since the last check? And will this scalar get
infinetely long, limited only by my RAM?
Thanks for any help,
Eric
p.s.: vICQ doesn't include timestamps in its output, so I can't
distinguish wether a message was sent once or repeatedly.