ravi45722 has asked for the wisdom of the Perl Monks concerning the following question:
In this code $intermediate_array11 contains error. I dont know which type of error it is. So, I am checking in each array. But my problem even the error present in @subscriber_error its checking in network & system error. By this my program is getting too late. If the error present in first array I want to skip the remaining. Help me???open (INTER,"$Intermediate_file") or print "cannot open file\n"; while (my $intermediate_line = <INTER>) { chomp $intermediate_line; my @intermediate_array = split(/\|/,$intermediate_line); if ($intermediate_array[12] eq "GSM") { $MO_userdep_error++ if grep { /^\Q$intermediate_array[11]\E$/ } + @subscriber_error; $MO_network_error++ if grep { /^\Q$intermediate_array[11]\E$/ } + @network_error; $MO_system_error++ if grep { /^\Q$intermediate_array[11]\E$/ } + @system_error; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Minimisation of codes (if grep {})
by Athanasius (Cardinal) on Oct 01, 2015 at 10:08 UTC | |
by ravi45722 (Pilgrim) on Oct 01, 2015 at 11:05 UTC | |
by hippo (Archbishop) on Oct 01, 2015 at 11:10 UTC | |
by ravi45722 (Pilgrim) on Oct 01, 2015 at 11:16 UTC | |
by choroba (Cardinal) on Oct 01, 2015 at 11:28 UTC | |
| |
|
Re: Minimisation of codes (hash)
by tye (Sage) on Oct 01, 2015 at 12:22 UTC | |
|
Re: Minimisation of codes (if grep {})
by Corion (Patriarch) on Oct 01, 2015 at 09:40 UTC | |
|
Re: Minimisation of codes (if grep {})
by Laurent_R (Canon) on Oct 01, 2015 at 11:16 UTC |