in reply to subroutine concatenation
use strict; my @codesref = undef; $codesref[0] = sub {print "SUB 1\n";}; $codesref[1] = sub {print "SUB 2\n";}; foreach my $code (@codesref){ $code->(); } [download]
More idiomatic and a bit less syntax:
my @codesref; push @codesref, sub { print "SUB 1\n" }; push @codesref, sub { print "SUB 2\n" }; $_->() for @codesref; [download]