Add check for undef for perl 5.14.2