in reply to Re: subroutine concatenation
in thread subroutine concatenation
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: subroutine concatenation
by revdiablo (Prior) on Feb 09, 2005 at 23:41 UTC |