Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Why callbacks?

by exussum0 (Vicar)
on Mar 30, 2007 at 17:51 UTC ( [id://607553]=note: print w/replies, xml ) Need Help??


in reply to Why callbacks?

Callbacks are great for injecting behaviour into something - ruby calls them mixins.

Instead of having variables referenced within the function, outward, to something lexically scoped or globally is really weird. I would expect the callback retaining the data and you querying it for the result. Hrm..

Replies are listed 'Best First'.
Re^2: Why callbacks?
by Joost (Canon) on Mar 30, 2007 at 17:56 UTC
      You can do mixins in Perl as well, by using Exporter to import methods into an OO class. CGI::Application uses this technique to add methods via plugins.
      Right right, was using the wrong terminology for what i meant. tnx.
      A reply falls below the community's threshold of quality. You may see it by logging in.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-03-29 07:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found