in reply to adding 1 to a char of 1
substr and string increment can make that even easier,
which prints "name_0010".my $file = 'name_0009'; substr($file, 5, 4)++; print $file, "\n";
The substr function is an lvalue, so any sort of mutator can be applied to it.
After Compline,
Zaxo
|
|---|