I have no OO techniques to suggest, just write clearer code.
Don't repeat yourself so much. This :-
if ($intermediate_array[12] eq "GSM" && $intermediate_array[9]
+ eq "MSubmit")
{
$intermediate_MO_cnt++;
}
if ($intermediate_array[12] eq "GSM" && $intermediate_array[9]
+ eq "MSubmit" && $intermediate_array[7] eq "MsgAccepted")
{
$total_MO_success++;
}
could be written as :-
if ($intermediate_array[12] eq "GSM" && $intermediate_array[9] eq
+"MSubmit") {
$intermediate_MO_cnt++;
if ( $intermediate_array[7] eq "MsgAccepted") {
$total_MO_success++;
}
}
It's clearer and easier to see what your intent was, and there are fewer places for bugs to hide.
Variable names like $del_user1_error , $del_user2_error, .. $del_userN_error are always a sign that you should have used any array and you're writing too much code. So instead you could do something like this :-
my @del_user_error_count;
for my $i (0..4) {
if ($cdr_post_array[11] eq $del_user_errors[$i]) {
$del_user_error_count[$i]++;
last;
}
}
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|