compose
# given sub { [@_] }
$code = $code->compose($code, 1,2,3);
$code->(4,5,6); # [[1,2,3,4,5,6]]
# this can be confusing, here's what's really happening:
my $listing = sub {[@_]}; # produces an arrayref of args
$listing->($listing->(@args)); # produces a listing within a listing
[[@args]] # the result
The compose method creates a code reference which executes the first argument (another code reference) using the result from executing the code as it's argument, and returns a code reference which executes the created code reference passing it the remaining arguments when executed. This method returns a Data::Object::Code object.
compose(CodeRef $arg1, Any $arg2) : CodeObject
method
5 POD Errors
The following errors were encountered while parsing the POD:
- Around line 10:
Unknown directive: =name
- Around line 14:
Unknown directive: =usage
- Around line 26:
Unknown directive: =description
- Around line 34:
Unknown directive: =signature
- Around line 38:
Unknown directive: =type