in reply to Re: I love anonymous functions!
in thread I love anonymous functions!

C's function pointers are not the same thing, but you can create a struct of a function pointer and a data pointer, and then you can create a function that calls that function with two arguments, the data in the struct and an additional pointer passed in.

This construct can then be treated similarly to how you'd use an anonymous function in Perl. You'll have to do the equivalent of closures by stuffing information into the data pointer and then binding it inside the function.

Alternately you can use Inline::Perl in CPR mode and then escape to actual Perl functions written in Perl wherever you want...