my $awesome = awesome(); print "still tickin'\n" while $awesome->(); sub awesome { my @a = (1 .. 10); return sub { shift @a }; } my %code_table = ( action1 => sub {print "doin' it\n"}, ); $code_table{action1}->(); # also awesome #### my ($c,$d); my ($c,d) = (4,5); # ...maybe we can live without the first my?