Perl Weekly Challenge 185: MAC Address and Mask Code
These are some answers to the Week 185 of the Perl Weekly Challenge organized by Mohammad S. Anwar.
Task 1: MAC Address
You are given MAC address in the form i.e. hhhh.hhhh.hhhh.
Write a script to convert the address in the form hh:hh:hh:hh:hh:hh.
Example 1:
Input: 1ac2.34f0.b1c2
Output: 1a:c2:34:f0:b1:c2
Example 2:
Input: abc1.20f1.345a
Output: ab:c1:20:f1:34:5a
MAC Address in Raku
This is done in a hurry, less than 45 minutes before the deadline. There might be a better or simpler way to solve this task, but using a couple of regexes is so simple that I don’t see any reason to try something else.


