why this perl code increment $v string by 1
use strict;
use warnings;
my $v='AAAAAYAQUypALsDz';
print ++$v
while the below is not:
use strict;
use warnings;
my $v='AAAAAmGJoD1dlkkt';
print ++$v
and i get Argument "AAAAAmGJoD1dlkkt" isn't numeric in preincrement (++)
any idea why this happens and how to increment such string by 1 using Perl?
/^[a-zA-Z]*[0-9]*\z/, the increment is done as a string, preserving each character within its range, with carry" The value in$vdoesn't match the pattern that activates the "magic" string increment.++; it couldn't possibly do what you want (whatever that is).