http://qs321.pair.com?node_id=142419

lucky1 has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to insert colons ':' into a string to represent a MAC address. I'm using join and split...

 print join(':', split /(..)/,'00a0c801adc6'),"\n<BR>";

But I get this as my output:

:00::a0::c8::01::ad::c6

Any idea why I get all the extra colons? My guess is that my regular expression is splitting (and joining) on a match at the start of every octet instead of just the end. How can I stop that from occurring? I've scoured "Programming Perl" and "Perl Cookbook" but can't find any help.
Thanks