ajay.awachar has asked for the wisdom of the Perl Monks concerning the following question:
Can anyone explain me the problem with above script and suggest a solution for it. Thanks and Regards, Ajay#!/bin/perl -w # Changing dir to Log dir `cd /opt/app1/osa/ebcp/5_5_4/log/`; open(FILE,'AppOsaEbcp1.log'); $major=0; $minor=0; $critical=0; while(<FILE>) { chomp; if(/MAJOR/) { $major=$major+1; } if(/CRITICAL/) { $critical=$critical+1; } if(/MINOR/) { $minor=$minor+1; } } close(FILE); printf("Count of MAJOR = $major, CRITICAL = $critical, MINOR = $minor +\n");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: FILE reading question.(closed filehandle) issue in script
by linuxer (Curate) on Apr 05, 2009 at 16:54 UTC | |
by Bloodnok (Vicar) on Apr 05, 2009 at 21:49 UTC | |
by ajay.awachar (Acolyte) on Apr 16, 2009 at 23:30 UTC | |
|
Re: FILE reading question.(closed filehandle) issue in script
by apl (Monsignor) on Apr 05, 2009 at 16:55 UTC | |
by ajay.awachar (Acolyte) on Apr 16, 2009 at 23:21 UTC | |
|
Re: FILE reading question.(closed filehandle) issue in script
by morgon (Priest) on Apr 05, 2009 at 19:51 UTC |