in reply to Preventing Use of uninitialized value

it depends how you want undef ne undef to act.

That's a conceptual question only you can answer, and Perl is right to complain about that.

my advice is to define an extra function adjustable to exactly to the behavior you need

The complicated logic inside the map merits an dedicated function (plus documentation)

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery