Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Regex overlap in MAC address

by VSarkiss (Monsignor)
on Sep 11, 2006 at 20:56 UTC ( #572399=note: print w/ replies, xml ) Need Help??

in reply to Regex overlap in MAC address

Personally, I prefer your second approach over the regex approach. I would make it a little more brief with sprintf, something like this:

my $mac_pad = join(':' => map { sprintf "%02s", $_ } split(/:/, $mac));
You could argue that it's too compact, but I think the join-map-split idiom is fairly common. YMMV.

Comment on Re: Regex overlap in MAC address
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://572399]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2015-11-25 15:22 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (681 votes), past polls