> $mac =~ s/([\dA-Fa-f]{1,2})/sprintf "%02X",hex($1)/eg;
> $m16 = join '',
> map { sprintf "%02X", hex $_ }
> split /[:-]/, $mac;
A matter of opinion...
I love these two examples of solving the same problem. I am sure that
lovers of the regex pattern language will look at the first and say,
"Oh, that is so pure regex" and use it. I, on the other hand, prefer the
more programmatic, regex light approach. I think it is more clear what
is happening. When I read it, I get a clear understanding from the code
what is supposed to happen.
-David