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::Perl
  • MooX::HandlesVia

go read those too, iykyk πŸ’œ


🫢 AUTHOR

Matthew Phillips <mattp@cpan.org> β€” the main character who made this happen πŸ‘‘


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