Re: Watching a modem

[email protected] ("Stuart Grimshaw")
Newsgroups perl.loop
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.