my way to tackle this would be to split the 6 groups of digits using
my @numbers = split(/:/, $string); after which you can access each of the sets as
$numbers[0] through to
$numbers[5]. Whenever you need them back in string form you can put it back together using
join(':', @numbers);
Now the real question is, last time I checked MAC addresses were in hexadecimal, so you're still in need of ABCDEF on top of the 0 through 9? Besides that, why would you want to iterate through every possible MAC address in the first place?