Re: Trapping ctrl/y in VMSPERL

[email protected] (doug brann)
Newsgroups perl.vmsperl
Message-ID <[email protected]>
Hi and thanks for the reply. I sent this message already, but forgot to hit "Reply All" Sorry. 
 
Anyhow,
 
I'm running version 5.8.6 and I tried this script: 
 
$SIG{QUIT} = \&routine;
 
while (1) {
 print "waiting\n";
 sleep(1);
}
 
sub routine {
  print "YAY\n";
}
 
when I did a Ctrl-Y, it did not catch the interupt. I even tried using a line like:
 
foreach (keys %SIG) {
  $SIG{$_} = \&routine;
}
 
and still couldn't trap CTRL-Y. I could get CTRL-C, but I really need to trap CTRL-Y.
 
Any ideas?
 
-Doug

--- On Mon, 12/29/08, Craig Berry <[email protected]> wrote:

From: Craig Berry <[email protected]>
Subject: Re: Trapping ctrl/y in VMSPERL
To: [email protected]
Cc: [email protected]
Date: Monday, December 29, 2008, 9:17 PM

 
On Sunday, December 28, 2008, at 08:52PM, "doug brann"
<[email protected]> wrote:

> I'm trying to trap ctrl/y in a VMS Perl script. Can anyone help? It
>isn't a signal, like ctrl-c, so the usual signal trapping won't
>work.

Actually it looks like SS$_CONTROLY is mapped to SIGQUIT.  Have you tried
trapping that?    It may depend of what version of Perl you are running.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.