You'll need to change statement modifiers:
do_something() if ...
to standard conditionals:
if ($some_condition) {
do_something();
}
to be able to use
else statements as suggested by
Corion:
if ($intermediate_array[12] eq "GSM") {
if (grep { /^\Q$intermediate_array[11]\E$/ } @subscriber_error
+) {
$MO_userdep_error++ ;
} elsif (grep { /^\Q$intermediate_array[11]\E$/ } @network_erro
+r) {
$MO_network_error++;
} else {
$MO_system_error++ if grep { /^\Q$intermediate_array[11]\E
+$/ } @system_error;
}
}
As mentioned by
Athanasius, replacing
grep by the
any function of
List::Utils module is also likely to speed up your program.
Also, testing for string equality might be slightly faster than a regex.