in reply to map and grep syntax question

No matter what, $newLoop should be an arrayref. If by "empty" you mean undef, something is seriously broken. If you mean arrayref to an empty array...

...Then your map has only one possible key, so it can have only one element. Apparently, this isn't enough to match the grep, so you get an empty list.

Update: Er, no, map returns a list, not a hash. I tend to forget that :) All odd-numbered elements will be identical, though.