Or using split with a 3rd argument of -1 to prevent it from dropping null elements and map to substitute the 'NULL's.
print join':', map{ $_ eq '' ? 'NULL' : $_} split ':', 'root:XXXXXXXXX
+XXXX:12103::::::',-1;
root:XXXXXXXXXXXXX:12103:NULL:NULL:NULL:NULL:NULL:NULL
Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
If I understand your problem, I can solve it! Of course, the same can be said for you.