Voltage level change in PC Parallel port to make a file run
I'm working on remote PC monitoring project and I believe that I have
resolved most of the hardware difficulty, but, as I am new to Perl, I
am asking for some advice.
What I want to do is monitor my PC's parallel port for a voltage level
change. This will activate a perl SMTP sendmail program and e-mail a
notification of an alarm condition.
Using an old QBasic program, I was able to monitor the parallel port's
address 128 by the
Qbasic command V = INP(Address) where the address is 889.
A change in the state (voltage level) of pin 10, 11, 12, 13 or 15 on
the parallel port causes a different, unique value for V.
My question is how can I convert this to a specific command to run my
Perl send e-mail program (this I have tested and I know it is
working). I know that if I did this in basic I would need a
conditional statement like:
10 V= INP(889)
20 IF V=127 GOTO 10 ELSE 30
30 "RUN Sendmail Program"
40 GOTO 10
I am using the Basic to illustrate the objective here...
Please forgive my lack of Perl knowledge here, but can anyone tell me
what the equivalent code would be in Perl?
Thanks!
Beachcomber