Avoid warnings for undef value passed to length in older perls