Hi there
I have a reference that I read from a file that I want to increment. The reference is of the form:
xx0001 where xx are letters and 0001 is a number between 0001 and 9999. What I want is to increment this number. I'm not concerned about what happens after 9999 at this moment in time. How can I go about incrementing this number?
I have tried the following:
This pulls out the correct values the brackets, but I'm unable to simply increment $3.
Many thanks
I have a reference that I read from a file that I want to increment. The reference is of the form:
xx0001 where xx are letters and 0001 is a number between 0001 and 9999. What I want is to increment this number. I'm not concerned about what happens after 9999 at this moment in time. How can I go about incrementing this number?
I have tried the following:
Code:
if (/($enwCyfeirnod=)(\w{2})(\d{4})/) {
my $rhifCyfeirnod = $3;
print $rhifCyfeirnod++;
}
This pulls out the correct values the brackets, but I'm unable to simply increment $3.
Many thanks