Data::...::Code(3pm)
π NAME
okay so bestie, welcome to Data::Perl::Role::Code β it's the wrapping class for Perl coderefs π
(and yes that's the Perl manual, section 3pm, the User Contributed Perl Documentation corner of the universe π«Ά).
β¨ VERSION
version 0.002011 β yes it's specific, we love a precise queen β
π§ SYNOPSIS
look, literally just this:
use Data::Perl qw/code/;
my $code = code(sub { 'Foo'} );
$code->execute(); # returns 'Foo';
that's it. that's the whole vibe π
πΈ DESCRIPTION
so basically this class hands you a lil wrapper π β plus methods β for interacting with Perl coderefs. it's giving "your coderef, but with manners" π
π PROVIDED METHODS
new($coderef)
constructs a brand new Data::Perl::Code object β¨ initialized to $coderef exactly as you passed it in, and hands it right back to you. no cap.
execute(@args)
calls the coderef with the given args. simple. iconic. slay π₯
execute_method(@args)
calls the coderef with the the instance as invocant and the given args.
β οΈ but bestie listen β this is currently disabled and it triggers a die π because of implementation details that are yet to be resolved. so like... don't. π
π SEE ALSO
Data::PerlMooX::HandlesVia
go read those too, iykyk π
π«Ά AUTHOR
Matthew Phillips <mattp@cpan.org> β the main character who made this happen π
π COPYRIGHT AND LICENSE
This software is copyright (c) 2020 by Matthew Phillips <mattp@cpan.org>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
okay bestie that's the whole page π¦ this page is perl v5.36.0, dated 2022-10-16, and it lives in the Data::...::Code(3pm) section π mwah, go call your coderefs πβ¨π
π¦ where this page comes from
- ubuntu noble: libdata-perl-perl 0.002011-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libdata-perl-perl 0.002011-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdata-perl-perl 0.002011-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms