$octetstr = join '', map chr(), 0xab, 0xcd, 0x00, 0x1d, 0x94, 0x56;; #### val = ''; map { $val .= sprintf("%02x",$_) } unpack "CCCCCC", $octetstr;; $mac = join( ":", unpack("a2 a2 a2 a2 a2 a2", $val ) );; print $mac;; ab:cd:00:1d:94:56 #### $mac = join ':', unpack '(H2)*', $octetstr;; print $mac;; ab:cd:00:1d:94:56