emptynet has asked for the wisdom of the Perl Monks concerning the following question:
This corresponds to the "eval {" line in the code fragment below. Can anybody help explain what I've clearly failed to grasp?panic: leave_scope inconsistency at slideshow.pl line xx. panic: leave_scope inconsistency.
Minds are like parachutes; they only work when open. (Sir James Dewar)do { $SIG{CHLD} = 'IGNORE'; undef $pid; die "fork: $!" unless defined ($pid = fork); if ($pid) { eval { local $SIG{ALRM} = sub { die "alarm\n" }; alarm $timeout; do { # Wait for a keypress # Take appropriate action SWITCHKEY: { if ($key eq "q") { $continue = 0; last SWITCHKEY; }; if ($key eq "n") { $action = $key; $index++ ; last SWITCHKEY; }; if ($key eq "b") { $action = $key; $index-- ; last SWITCHKEY; }; if ($key eq ".") { alarm 0 ; last SWITCHKEY; }; $action = "r"; $index = int rand @files; } } until $key ne "."; alarm 0; # Close the current image window (by killing the child) kill TERM => $pid; }; if ($@) { # Timed out die unless $@ eq "alarm\n"; kill TERM => $pid; SWITCHACTION: { # n -> next image if ($action eq "n") { $index++; last SWITCHACTION; }; # b -> previous image if ($action eq "b") { $index--; last SWITCHACTION; }; # r -> random image if ($action eq "r") { $index = int rand @files; last SWITCHACTION; }; } } } else { # This is the child process # exec an image viewer over the child process... exec("/usr/bin/ee '$file'"); } } until not $continue;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 1: Why does my parent panic when comitting serial infanticide?
by tilly (Archbishop) on Nov 28, 2000 at 07:59 UTC | |
by emptynet (Sexton) on Nov 29, 2000 at 04:23 UTC |