my $value = "8:0:20:0:2:10"; print join "", map { sprintf "%02s", $_ } split /:/, $value;
or
print sprintf "%02s%02s%02s%02s%02s%02s", split /:/, $value;
Updated as per merlyn's and sauoq's comments below (changed %02d to %02s).
perl -le 'print+unpack("N",pack("B32","00000000000000000000001000010100"))'
In reply to Re: Converting MAC Address
by rob_au
in thread Converting MAC Address
by HiFoo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |