Normally I would reccomend openbsd, it is increadble secure, and offers a great perl environment. Remember how bored and curious I got last time I was unemployed, and you seem to really want to delve into the workings of your system, I would wholeheartedly reccommend linux from scratch
Their web page analygizes it similar to building a house, they will give you a skeleton, you get to finsih it.
"The social dynamics of the net are a direct consequence of the fact that nobody has yet developed a Remote Strangulation Protocol." -- Larry