in reply to RE: Setting up signal handlers for an object with access to $self
in thread Setting up signal handlers for an object with access to $self

The point is to give the signal handler access to an object. If you simply point the signal handler to a subroutine, you do not have a way of accessing $self, unless it is stored in a class variable. By defining the signal handler with a closure, you can call the signal handler as if it were a method instead of a regular subroutine, therefore giving it access to $self (and the ability to access its methods and data).
  • Comment on RE: RE: Setting up signal handlers for an object with access to $self

Replies are listed 'Best First'.
RE: RE: RE: Setting up signal handlers for an object with access to $self
by chromatic (Archbishop) on Apr 19, 2000 at 23:19 UTC
    Hey, you're right! Very nice. (The word closure makes it obvious now.)