ISAI student has asked for the wisdom of the Perl Monks concerning the following question:
require Expect; use strict; $SIG{'INT'}=sub {print "Al Bundy rules!\n";}; $SIG{CHLD}='IGNORE'; my $proc=Expect->spawn("sleep 10"); unless ($proc->expect(10,"Mommy")) { print "Stop selling women shoes\n"; }
Whe I hit ^c once, I get:
And the script exits. I have expected the scipt NOT to exit after one ^c, but after n presses (or 10 seconds). What am I doing wrong? PERL version is: This is perl, v5.8.8 built for x86_64-linux-thread-multiliord@analog2 238 > tester.pl Al Bundy rules! Stop selling women shoes
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: INT signal kills process run with expect, when $SIG{'INT'} is set
by salva (Canon) on Feb 22, 2011 at 09:34 UTC | |
|
Re: INT signal kills process run with expect, when $SIG{'INT'} is set
by ISAI student (Scribe) on Feb 22, 2011 at 08:34 UTC | |
by cdarke (Prior) on Feb 22, 2011 at 09:05 UTC | |
by ikegami (Patriarch) on Feb 22, 2011 at 16:53 UTC |