Results 1 to 3 of 3
Jun 10, 2013, 04:27 #1
- Join Date
- Jun 2013
- 0 Post(s)
- 0 Thread(s)
PERL: Strange outcome of variable value manipulation
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.
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";
MaxFile: FOT05172.TXT File Name: FOT05172 Current Sequence Num: 3 Next Sequence Num: 2
Can anyone spot a mistake in my code?