![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Perl Error with ftptail script | Cooki3s! | UNIX for Dummies Questions & Answers | 2 | 05-04-2009 11:46 AM |
| SolarisCron job perl script execution error | sonu2die4 | Shell Programming and Scripting | 4 | 02-06-2009 05:22 PM |
| Perl script error | pietie | Shell Programming and Scripting | 4 | 10-15-2008 09:05 AM |
| Perl Script Error with find command | MKNENI | Shell Programming and Scripting | 4 | 03-26-2008 12:02 PM |
| String replace perl script error | MobileUser | Shell Programming and Scripting | 6 | 05-04-2006 09:18 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
error in output of perl script
Hi,
This is my piece of code. Code:
my $logFile = $ARGV[0];
die "usage: $0 <logFile>" unless $logFile;
die "Logfile $logFile doesn't exist" unless -f "$logFile";
open(my $log, "<", $logFile) or die "Can't open $logFile for reading.";
print "Processing file $logFile...\n";
#my $authenticates = {};
my $n = 0;
my $ArcotIDError_Count = 0;
my $QnAError_Count = 0;
my $UPError_Count = 0;
my $OTPError_Count = 0;
my $errorCode;
while(my $line = <$log>) {
$n++;
$line =~ tr/\r\n//d;
if($line =~ /Handling NSPAdvice for mechanism \[4\]/) {
while ( $line = <$log> ) {
if ($line =~ /Authentication mechanism returned \[(\d+)\]/) {
my $errorCode = $1;
print "$errorCode\n";
if ($errorCode != 0 && $errorCode != 1) {
$ArcotIDError_Count++;
}
}
next;
}
}
}
print "Total Number Of ArcotID Authentication ErrorCode returned is $ArcotIDError_Count\n";
Can anyone suggest me if any problem is there. One more thing i like to know is that-- I can add OR condition in this statement Code:
if($line =~ /Handling NSPAdvice for mechanism \[4\]/) as if($line =~ /Handling NSPAdvice for mechanism \[4\]/ || /Handling NSPAdvice for mechanism \[3\]/) Thanks NT |
|
||||
|
Hi NT,
Don't know if I personally can be of any help, but I if you supply the contents of the $logFile, perhaps this will be useful for the persons trying to help. You can also try to use the debugger (#!/bin/perl -w -d) to see where the code does something different than expected. And do you expect 354 as output but you get 142, or do you get 142 where you expect 354 ? E.J. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|