in reply to MAC Pretty-printer

Whenever I see chop, wonder if something is wrong. Not saying that it's wrong to use it here, but just saying. What about this code?
s/[[:^xdigit:]]//g; $mac = lc join ":", unpack "(A2)*", $_

thor

Feel the white light, the light within
Be your own disciple, fan the sparks of will
For all of us waiting, your kingdom will come

Replies are listed 'Best First'.
Re^2: MAC Pretty-printer
by moot (Chaplain) on Jan 27, 2005 at 01:33 UTC
    In this case, I'm chopping the character added by the regexp, so I'm pretty sure it's safe. While your code is cleaner, my original is leaner - I went for brevity over clarity, since it sees a lot of use as a one-liner in passing MACs to non-perlish scripts (yes, I know, we have some of those.. I'm sorry ;) ).