I'm not clear what your data looks like: the question title says "binary string" but the text talks about "text string". Some examples and/or a more complete definition would be helpful.
Incrementing a string representing an unsigned binary number like "001101" is easy: $value =~ s{(^|0)(1*)$}{1 . ("0") x length($2)}e.
Incrementing a string representing an unsigned decimal number like "123456" is an extension of that: $value =~ s{(^|[0-8])(9*)$}{(($1 || 0) + 1) . ("0") x length($2)}e.
There are similar approaches possible for other cases.
Hugo
In reply to Re: Add 1 to an arbitrary-length binary string
by hv
in thread Add 1 to an arbitrary-length binary string
by einhverfr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |