Thanks for that idea. I'll try it and report back with my results.

---------------------------------------
 Stuart Grimshaw         |
 Schoolsnet LTD          |   Special
 www.schoolsnet.com      |   Projects
                         |   Developer
 [EMAIL PROTECTED]
---------------------------------------

----- Original Message -----
From: Joshua N Pritikin <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: 23 May 2000 14:14
Subject: Re: Watching a modem


> On Tue, May 23, 2000 at 01:21:49PM +0100, [EMAIL PROTECTED] wrote:
> > while (1) {
> >     print "RING Detected\n" if ($Port->modemlines &
> >             $Port->MS_RING_ON);
> > }
> >
> > All it does obviously is enter an infinate loop and print when it
detects a
> > ring.
> >
> > How can I use Event->var to watch for a change in $Port->modemlines?
> >
> > I've tried this, and it doesn't work :
> >
> > Event->var(
> >     var=>\$Port->modemlines ,
> >     cb=>\&checkring,
> >     poll=>'rw');
>
> $Port->modemlines is a method, not a variable.  Will a timer serve your
> purpose?  Something like:
>
>   Event->timer(interval => .1, cb => \&checkring);
>
> ??
>
> > loop();
> >
> > undef $Port;
> >
> > sub checkring {
> >  if($Port->modemlines & $Port->MS_RING_ON) {
> >   print "Ring Detected\n";
> >   unloop();
> >  }
> > }
>
> --
> "May the best description of competition prevail."
>           via, but not speaking for Deutsche Bank

Reply via email to