Just build your own function to increment theid's. Won't have to worry about any out of bounds issues then.
use strict;
my $hex = "24d0e803adb7";
for (0..16) {
$hex = inc_hex($hex);
print $hex, "\n";
}
sub inc_hex {
my @a = reverse map {hex} split '', $_[0];
$a[my $i = 0]++;
while ($a[$i] == 16) {
$a[$i] = 0;
$a[++$i]++;
}
return join '', map {sprintf "%x", $_} reverse @a;
}
output
24d0e803adb8
24d0e803adb9
24d0e803adba
24d0e803adbb
24d0e803adbc
24d0e803adbd
24d0e803adbe
24d0e803adbf
24d0e803adc0
24d0e803adc1
24d0e803adc2
24d0e803adc3
24d0e803adc4
24d0e803adc5
24d0e803adc6
24d0e803adc7
24d0e803adc8
|