Hi,

I'm working with the below if statement in my code and it doesn't seem to matching the condition correctly:

Code:
if ($maxFile ne "") { 
                     my $fileName = basename($maxFile,".TXT");
                     my $currentSeqNum = substr($fileName,-1,1);
                     my $nextSeqNum = $currentSeqNum + 1;
                    }
   else { my $nextSeqNum = 0; }

print "File Name: $fileName\n\n";
print "Current Sequence Num: $currentSeqNum\n\n";
print "Next Sequence Num: $nextSeqNum\n\n";

}
this returns:

Code:
MaxFile: FOT05172.TXT

File Name: 

Current Sequence Num: 

Next Sequence Num:
$maxfile is returned from a DBI call.

Any ideas where I'm going wrong?

Thanks

Chris