Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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

by ZZamboni (Curate)
on Apr 19, 2000 at 23:03 UTC ( [id://8067]=note: print w/replies, xml ) Need Help??


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.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://8067]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-15 13:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found