Data::Perl::Role::Code(3pm)

Data::Perl::Role::Code3pm

Wrapping class for perl coderefs.

Usage

  use Data::Perl qw/code/;
  my $code = code(sub { 'Foo'} );
  $code->execute(); # returns 'Foo';

Version

version 0.002011

Overview

This class provides a wrapper and methods for interacting with Perl coderefs.

Provided methods

new($coderef)

Constructs a new Data::Perl::Code object, initialized to $coderef as passed in, and returns it.

execute(@args)

Calls the coderef with the given args.

execute_method(@args)

Calls the coderef with the the instance as invocant and given args. This is currently disabled and triggers a die due to implementation details yet to be resolved.

Releases

7 releases since Debian 8 (Jessie); the text changed 4 times.

  1. 8–9
  2. 10
  3. 11
  4. 12–13
  5. Arch

Author

Matthew Phillips <[email protected]>

From perl-data-perl 0.002011-8 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.