my $goal = "what is to be accomplished?";
my @tasks = qw( all the necessary steps to get there );
if ( absolutely_necessary($goal) )
{
do work(@tasks) or die "$!, but the rest of us forge on";
}
elsif ( want_to_accomplish($goal) )
{
do work(@tasks);
}
Could be reduced to:
my $goal = "what is to be accomplished?";
my @tasks = qw( all the necessary steps to get there );
do work(@tasks) if ( want_to_accomplish($goal) );
Everybody writes their own sub work and sub want_to_accomplish of course. I suppose even sub absolutely_necessary is subjective in part, but there is apt to be a great deal of commonality there. Besides, isn't completely eliminating it a nice thought? The disappearance of the or die is a nice (or possibly horrifying?) thought too. :-)
Just another Perl hooker - will code for food
|