From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96075324106598.tru64-unix-managers.marc@archive.invalid> From: Neil Movold Date: Sun, 15 Oct 1995 23:27:40 +0000 To: tru64-unix-managers Subject: Perl %SIG Array and Perl Menus (menu.pl) X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96075324106598 In the past, when I have written Perl scripts to use the %SIG array to capture interrupt signals, I have been able to intercept a -C from the user and ignore the user's action. I use this feature to disallow users from exiting the controlled script I have written, unless they use the way I want them to exit the script. At the moment, I have been writting a large Perl Menus program and I would like the same functionality. However, implementing the following subroutines as I normally do, does not give me the desired result. # # ################## S I G I N T ######################### # sub sigint { $SIG{"INT"} = "nicetry"; $SIG{"HUP"} = "nicetry"; $SIG{"QUIT"} = "nicetry"; } # # ################## N I C E T R Y ######################### # # sub nicetry { print("^G^G"); } What happens is the routines setup the array properly and infact call the routine "nicetry", which just beeps twice. But instead of returning to the place in the code where the -C was entered, the program actually exits. I believe this has something to do with the fact that the interrupt was given while displaying a menu using "&menu_display", which is a routine from the menu.pl library. The interrupt does not even return to the line after this menu_display call. I cannot find anywhere in my code where the the subroutine nicetry returns to. I have tried to use the menu_quit_routine and menu_setexit routines, but they do not work as well. The next thing I will try is to actually go into the menu.pl code itself, however this is not what I would like to do as I don't want to have problems with future versions of menu.pl. Any suggestions would be appreciated. Neil :-) \\\// (o o) ------------------ooO-(_)-Ooo----------------------------------------- Neil Movold Phone : +1 809 296-1800 Special Operations Consultant Fax : +1 809 295-7269 ( i.e. the guy who has to make it all work :-) ) Internet (Bermuda) Limited E-mail : nmovold@ibl.bm P.O. Box HM2445 Hamilton, Bermuda HM JX