in reply to Re^3: Not able to capture information
in thread Not able to capture information

For timing comparisons, the Benchmark module is excellent.

I tend to write the most straight forward code first and then tweak when necessary. I recently had a project where I changed just a single regex line and it cut 2 minutes off a 10 minute run time! If you do anything, no matter how simple enough millions of times, it adds up. Considerable experimentation can be required. In this particular case, I don't know without measuring what the performance difference would be.

Anyway, I think the OP has a number of fine examples of different approaches.