Passing arguments to an error handler 
Author Message
 Passing arguments to an error handler

Is there a way to pass arguments to your signal handler?

If not, can anybody suggest a way for a bunch of scripts to share a
common signal handler, where the thing the handler must clean up will
be different for different scripts (and therefore must be made known to
the handler on interrupt)?  Or is this not wise?

And even if it isn't, can I still do it? ;-)

-- tdk



Sat, 03 May 1997 01:57:03 GMT  
 Passing arguments to an error handler

Quote:

>Is there a way to pass arguments to your signal handler?

>If not, can anybody suggest a way for a bunch of scripts to share a
>common signal handler, where the thing the handler must clean up will
>be different for different scripts (and therefore must be made known to
>the handler on interrupt)?  Or is this not wise?

Probably not.

Quote:
>And even if it isn't, can I still do it? ;-)

The signal handler is always called with just one argument, the signal
name.  It can of course be written to look at a global (or package)
variable and behave accordingly.  Global variables are in general
not a good idea, but this may be a case of appropriate usage.

Anno



Sat, 03 May 1997 19:40:42 GMT  
 Passing arguments to an error handler



:>
:>Is there a way to pass arguments to your signal handler?
:>
:>If not, can anybody suggest a way for a bunch of scripts to share a
:>common signal handler, where the thing the handler must clean up will
:>be different for different scripts (and therefore must be made known to
:>the handler on interrupt)?  Or is this not wise?
:
:Probably not.

That's what I thought.  Shucks.

:>And even if it isn't, can I still do it? ;-)
:
:The signal handler is always called with just one argument, the signal
:name.  It can of course be written to look at a global (or package)
:variable and behave accordingly.  Global variables are in general
:not a good idea, but this may be a case of appropriate usage.

I suppose I'll end up using a package.  Thanks!

-- tdk



Sun, 04 May 1997 23:02:50 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Subroutine with arguments and object method as event handler

2. How to pass Socket Handler as Parameter

3. Passing File Handler

4. passing file handler to a package method

5. passing functions as arguments to subroutines

6. Passing arguments to a script in HTML

7. MacPerl newbie: passing arguments?

8. passing functions as arguments

9. Passing Arrays As Arguments?

10. Argument passing screwed?

11. How to pass a NULL argument?

12. Passing arguments to subrtns (Help!!)

 

 
Powered by phpBB® Forum Software