A less succinct substr approach.
knoppix@Microknoppix:~$ perl -E ' > $mac = q{525400eb8b36}; > substr $mac, $_, 0, q{:} > for reverse grep { ! ( $_ % 2 ) } 2 .. 10; > say $mac;' 52:54:00:eb:8b:36 knoppix@Microknoppix:~$
Cheers,
JohnGG
In reply to Re: Insert colons into a MAC address
by johngg
in thread Insert colons into a MAC address
by mantager
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |