Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package CatalystX::Modern::Function;
- use warnings;
- use strict;
- use parent 'Devel::Declare::MethodInstaller::Simple';
- sub import {
- my ($class, %opts) = (@_);
- $class->install_methodhandler(
- name => 'function',
- into => caller,
- %opts,
- );
- }
- sub parse_proto {
- my ($self, $proto) = @_;
- $proto ||= '@args';
- $proto =~ s/[\r\n]//g;
- return "my ($proto) = (\@_);";
- }
- ########
- method lowercase($string) {
- my $test = function($a) { '' };
- my $method = function($extra) {
- $string
- ->lc
- ->do(function { my $i = shift;
- "$extra:$i";
- });
- };
- return $method->('extra');
- }
- #####
- #line 37 "t/object.t"
- my $method = &function(sub {
- #line 33 "t/object.t"
- my($extra) = @_;
- #line 36 "t/object.t"
- $string->lc->do(&function(sub {
- #line 34 "t/object.t"
- my(@args) = @_;
- #line 34 "t/object.t"
- my $i = shift @_;
- #line 35 "t/object.t"
- "${extra}:$i";
- }
- ));
- }
- );
Add Comment
Please, Sign In to add comment