This is a very rudimentary Perl CGI script that I use to send commands to Marcus
Mueller's IRServer software. It performs no error checking whatsoever. Use
modify, distribute at will. USE AT YOUR OWN RISK !

HOW IT WORKS

The script should be run on a local webserver. You can use the supplied HTML
files as a template to make for your own "remote control" page. You can either
supply the name of the remote and the command name as stored in the remotes
directory of IRServer to the CGI or use the name of a macro defined in a
'macros' file in the same directory as the Perl script. You can use macros to
send compound commands to a device, e.g. in case you want to have links for
individual TV stations on your webpage and want IRTrans to send the
corresponding two or three digit channel code to the TV. The script contacts
IRServer on its Lirc port 8765 via tcp and sends the corresponding command
string(s). (So it should basically also work with the Lirc server).

HOW TO INSTALL

First make sure you have installed a working perl environment on your system.
This should already be the case for most Linux environments. For Windows I
recommend using the ActivePerl distribution from ActiveState
(http://www.activestate.com/Products/ActivePerl/?_x=1) or Cygwin's perl package
(www.cygwin.com). If you need fine control over the timing between macro
commands you should uncomment the corresponding lines in the script. The
Time::HiRes package is part of the ActivePerl distribution. If you have the
cygwin standard install you will need to install it via CPAN ('install
Time::HiRes' will do).
Next you will need to install a local webserver. Please be aware that unless you
do enable access control via client IP identification or password or have a
firewall installed, your webserver will be accessible from the internet. Keep
this in mind when hooking up critical devices and proceed at your own risk. If you
are on Windows I recommend installing Apache2 (http://httpd.apache.org). It's not
too hard to install and will give you greatest stability.
Next copy the html files into the server html base directory (for Apache2 this is
htdocs by default) and the control.pl and macros file into the CGI directory. 
Give the webserver the full path to your perl interpreter. Do not forget to set up 
access restrictions for your webserver. Also you might want to change its 
portnumber.
On linux don't forget to grant execute rights to the control.pl file (chmod 755
control.pl).

In the example files an invisible frame is used to display a debug message from
the CGI script. If you do not want to use frames disable line 12 and 16 and
uncomment line 20 to use reload. Do not forget to change the link targets in the
html files. Using frames avoids flicker in IE6 when clicking on commands.
Mozilla users don't have this problem anyway.

THE MACROS FILE

<macro name> <remote name> <command 1> <command 2> ...

Have fun and many thanks to Marcus Mueller for the awesome hardware design and
server software!

Timo Duchrow (duchrow@informatik.uni-muenchen.de) 2004-04-21