In Net::IMAP and others, a module will pass you data by requiring that you pass a subroutine reference that the module will execute when the time comes to pass back the data.
Then I have to use uncomfortable globals to get the data out of that sub and it's harder to debug because I don't know what's calling my sub and what my sub returns.
Am I missing the beauty of callbacks? What are they for? Why would someone use them instead of just returning a hash ref or something like that?
In reply to Why callbacks? by pileofrogs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |