Re: Trapping ctrl/y in VMSPERL
[email protected] ("Craig A. Berry")
| Newsgroups | perl.vmsperl |
|---|---|
| Message-ID | <[email protected]> |
On Dec 31, 2008, at 7:18 PM, doug brann wrote:
> 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?
Hmm. I'm back home and near my VMS systems and I can see the same
thing with a recent development snapshot. There may not be any way to
do this in pure Perl. I confess I don't know offhand all the details
of trapping Control-Y in one of the VMS-native languages either. You
might have a look at the I/O User's Reference and be able to work out
something:
http://h71000.www7.hp.com/doc/73final/6136/6136pro_015.html#index_x_643
A possible workaround is a DCL wrapper that traps Control-Y and
restarts the Perl script after handling whatever needs to be handled.
________________________________________
Craig A. Berry
mailto:[email protected]
"... getting out of a sonnet is much more
difficult than getting in."
Brad Leithauser