in reply to map question

What about it doesn't work? This looks like a code fragment, and it would be easier to answer if I knew more about your problem and your code.

I haven't investigated closely, but using s/// inside map may be tripping you up: modifying $_ during map modifies the array you're mapping over. Running that same map code twice doesn't make much sense to me.

~dewey