outputs:my $code = sub {print "Sub 1\n"}; $code = joincoderefs( $code, sub {print "Sub 2\n"}); &$code; sub joincoderefs { my @refs = @_; return sub { $_->() for @refs }; }
Sub 1 Sub 2
--
flounder
In reply to Re^2: subroutine concatenation
by flounder99
in thread subroutine concatenation
by imcsk8
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |