in reply to What is a
One of your function calls is returning undef. I can't think of much more to say.