Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://572399]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2017-10-17 02:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (218 votes). Check out past polls.

    Notices?