The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

POE::Callback - object wrapper for callbacks with lexical closures

SYNOPSIS

        # TODO - Make this a complete working example.
        my $callback = POE::Callback->new(
                name => "Pkg::sub",
                code => \&coderef,
        );
        $callback->(@arguments);

DESCRIPTION

POE::Callback wraps coderefs in magic that makes certain lexical variables persistent between calls.

It's used internally by the classes that comprise POE::Stage.

new CODEREF

Creates a new callback from a raw CODEREF. Returns the callback, which is just the CODEREF blessed into POE::Callback.