tc1364 has asked for the wisdom of the Perl Monks concerning the following question:
Sample output is below. Please note the value for $key was removed. Program Error 4 - <$key> :Office Channel Not Logged In :No New Data Was Co Office Channel Not Logged In No New Data Was Collected Program Error 4 - <$key> :SECTION IS NOT IN EADAS CLASS :SECTION IS NOT IN SECTION IS NOT IN EADAS CLASS SECTION IS NOT IN EADAS CLASSforeach $key (keys %analysis) { @msg = (); $val = $analysis{$key}; @msg = split /:/, $val; $anal_host_flg = 0, $anal_data_flg = 0, $anal_entries = 0; $anal_class_flg = 0, $anal_image_flg = 0, $anal_channel_flg = 0; foreach $message (@msg) { print "$message\n"; $anal_entries = $#msg + 1; if ($anal_entries == 0) { print "Program Error 3 - $key $val\n"; } if ($message =~ /SECTION IS NOT IN EADAS CLASS/) { $anal_class_flg = $anal_class_flg + 1; } elsif ($message =~ /Office Image Running/) { $anal_image_flg = $anal_image_flg + 1; } elsif ($message =~ /Office Channel Not Logged In/) { $anal_channel_flg = $anal_channel_flg + 1; } elsif ($message =~ /Telephath Unable To Connect to Office/) { $anal_host_flg = $anal_host_flg + 1; } elsif ($message =~ /No New Data Was Collected/) { $anal_data_flg = $anal_data_flg + 1; } else { print "Program Error 4 - $key $val\n"; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Is My Split Or My Pattern Bad?
by dragonchild (Archbishop) on Nov 22, 2004 at 17:47 UTC | |
by tc1364 (Beadle) on Nov 22, 2004 at 18:15 UTC | |
by dragonchild (Archbishop) on Nov 22, 2004 at 18:35 UTC | |
|
Re: Is My Split Or My Pattern Bad?
by ikegami (Patriarch) on Nov 22, 2004 at 17:46 UTC | |
|
Re: Is My Split Or My Pattern Bad?
by steves (Curate) on Nov 22, 2004 at 18:11 UTC | |
by tc1364 (Beadle) on Nov 22, 2004 at 18:25 UTC | |
by jryan (Vicar) on Nov 22, 2004 at 19:40 UTC | |
|
Re: Is My Split Or My Pattern Bad?
by fglock (Vicar) on Nov 22, 2004 at 17:53 UTC | |
by tc1364 (Beadle) on Nov 22, 2004 at 18:23 UTC |