in reply to Re^2: increment a hex number
in thread increment a hex number
That still involves treating the values as numbers rather than as strings:
That snippet will print "0x040000".$_ = "0x030000\n"; s/0x([\da-f]+)/sprintf("%#.*x", length($1), hex($1) + 0x10000)/ei; print;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: increment a hex number
by Anonymous Monk on May 10, 2010 at 23:00 UTC |