in reply to Re: subroutine concatenation
in thread subroutine concatenation

Thanks!! i just did that
it ended up like this:
use strict; my @codesref = undef; $codesref[0] = sub {print "SUB 1\n";}; $codesref[1] = sub {print "SUB 2\n";}; foreach my $code (@codesref){ $code->(); }
and it worked just fine


ignorance, the plague is everywhere
--guttermouth

Replies are listed 'Best First'.
Re^3: subroutine concatenation
by Anonymous Monk on Feb 09, 2005 at 21:51 UTC

    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;