My problem with the second approach (apart from the "read only" snag) is that it turns constant data into something that requires computation. Certainly, there are times when computation is necessary with constant data, such as when you are constructing a data structure like an array of arrays: you take tab-separated data, split on the tabs, and produce array references. That's certainly easier and faster to write than producing the data structure in the code itself. But in this case, I think it was overkill.