in reply to Iteration condition...
Now, this is totally untested but something like this should work...my $machine = {$Start => \&do_this, $Finish => \&do_that}; my $doit = \&do_this; foreach my $line(@Input) { my $func = $machine->{$line}; $doit = $func if (defined $func); $doit(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Iteration condition...
by moritz (Cardinal) on Mar 31, 2008 at 15:55 UTC | |
by wade (Pilgrim) on Mar 31, 2008 at 16:32 UTC |