in reply to minimize window to systray

ActiveState sells a product called Perl Development Kit (PDK). There are several excellent utilities in there, that I use every day. One of which is called "PerlTray" and will package a perl script up into an EXE and allow it to run from the tray.