![]() |
|
Syntactic Confectionery Delight | |
PerlMonks |
Trying to Understand Callback(s)by DanielSpaniel (Scribe) |
on Nov 23, 2017 at 22:06 UTC ( #1204168=perlquestion: print w/replies, xml ) | Need Help?? |
DanielSpaniel has asked for the wisdom of the Perl Monks concerning the following question: Hi, This isn't a problem so much as me trying to understand something, but I hope someone might be kind enough to help explain. So, I have some code, which was sourced from elsewhere (it's from a Mojo example), which uses a callback, but I don't really quite get the idea of callbacks, and particularly I don't understand the syntax. $ua->get($url => \&get_callback);So, sure enough there is a subroutine called get_callback, but I don't really understand what's happening. I did find an O'Reilly doc on callbacks, but the syntax was different.
I don't really get the first line of the get_callback routine either, when nothing appears to be being passed across If someone might explain in kiddie-steps what's happening, and why, then it would be much appreciated. Many thanks!
Back to
Seekers of Perl Wisdom
|
|