(Just as a note: I changed the subject to reflect the content of the post!
It was originally [perl-win32-gui-users] perl-win32-gui-users@lists.sourceforge.net  ~ by mistake)
 
Thanks Greg...but that didn't work.
I tried  $SIG{__DIE__} = $SIG{QUIT} = $SIG{HUP} = $SIG{INT} = $SIG{KILL} = $SIG{QUIT} = $SIG{TERM} = $SIG{STOP} = $SIG{BREAK} = $SIG{ABRT} = \&Main_Terminate;
where Main_Terminate is the method that I am using as the handler.
But no success for logoff.
I am getting a list of signals using the following at a cmd prompt in Windows XP (SP2):
 
C:\>perl -e "print join(' ', keys %SIG)"
ABRT BREAK HUP NUM19 FPE CLD NUM12 NUM16 NUM18 NUM17 STOP NUM24 NUM10 INT SEGV
QUIT KILL PIPE NUM05 CONT NUM06 NUM07 ILL TERM ALRM CHLD
 
I also tried the following instead of using the SIG hash:
 use sigtrap qw(handler Main_Terminate normal-signals error-signals);
which from what I understand should define the handler as Main_Terminate for all signals in the normal and error lists
    normal = HUP, INT, PIPE, TERM
    error = ABRT, BUS, EMT, FPE, ILL, QUIT, SEGV, SYS, TRAP
    - according to O'Reilly's PERL Cookbook.
 
- Calvin Perine

>>> Greg Osborne <journey@eagle.ontheside.net> 12/22/2004 11:17:29 AM >>>
I'm taking a stab in the dark here, but...

When a unix or linux system sees a user leave or lose connection,
the SIGHUP signal is sent to any programs that person has opened. 
Typically this kills the programs, but some programs will catch the signal
and then perform tasks to stay alive (such as forking into the background)
or perform some save/cleanup code before exiting.  You might try trapping
that signal.

Another thought is SIGKILL or SIGQUIT, but those may not be as likely to
give what you want.

Hope it helps.

- Greg


>>> Greg Osborne <journey@eagle.ontheside.net> 12/22/2004 11:17:29 AM >>>
I'm taking a stab in the dark here, but...

When a unix or linux system sees a user leave or lose connection,
the SIGHUP signal is sent to any programs that person has opened. 
Typically this kills the programs, but some programs will catch the signal
and then perform tasks to stay alive (such as forking into the background)
or perform some save/cleanup code before exiting.  You might try trapping
that signal.

Another thought is SIGKILL or SIGQUIT, but those may not be as likely to
give what you want.

Hope it helps.

- Greg