panic: leave_scope inconsistency at slideshow.pl line xx. panic: leave_scope inconsistency. #### 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;