Locale-Codes is full of "return undef".
One example is all_country_names which returns (undef) instead of ()
when called with an invalid codeset.
If I see it correctly you can safely do s/return undef/return/g on all
sources without breaking anything.