my $old_id = "I000199"; my ($char, $num) = unpack("A1A6", $old_id); $num += 1; my $new_id = sprintf "%s%06d", $char, $num;