in reply to How to write good code?
IMHO your second solution is much more readable, but it suffers from bad indentation. Fix that, and be happy.
Of course you could also use a dispatch table:
my %dispatch = ( daily => \&addDaily, test => \&addTest, ); foreach my $token (@tokens){ if($token =~ m/HREF="([a][^\/]*)/i) { my $extracted = $1; next unless $extracted =~ m/win/i; if (eval { $dispatch{$daily_test}->($extracted) } == 1 ) { push(@buildList, $extracted); } } }
|
|---|