Hi,

I only dip my toe into PERL programming on the odd ocassion so I was wondering if anyone had any ideas as to why the below is happening:

When I run my PERL script the variable values seem to get mixed up.

Code:
my $fileName = basename($maxFile,".TXT");
my $currentSeqNum = substr($fileName,-1,1);
my $nextSeqNum = ($currentSeqNum)++;

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

Code:
MaxFile: FOT05172.TXT

File Name: FOT05172

Current Sequence Num: 3

Next Sequence Num: 2
$maxFile gets it value from an sql query using DBI which is correct. The problem lies in the fact that the "Current Sequence Num:" and "Next Sequence Num:" values seem to be the wrong way round.

Can anyone spot a mistake in my code?

Thanks

Chris