I want to use CTRL-C to abort execution of a routine (but not of the
main program). Something like this:

        # main program
        $SIG{'INT'}='IGNORE';
        (...)
        &myroutine()
        (...)
        sub myroutine{
                # do something
                (...)
                $SIG{'INT'}=&abortmyroutine();
                # do some time consuming stuff...
                (...)
                $SIG{'INT'}='IGNORE';
                (...)
                return 1;
                sub abortmyroutine{
                        # do some cleaning...
                        (...)
                        $SIG{'INT'}='IGNORE';
                        # return from myroutine into main program
                        (??????????????)
                }
        }

Pressing CTRL-C executes abortmyroutine(), but what can the latter do to
exit myroutine? Putting exit in place of (??????????????) would exit the
program, which is not what I want. Is this possible?

--
Jorge Almeida

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to