sub somefunc_for_arrays { my @answer = get_array2(); if (!(scalar @answer)) { die 'get_array2() returned an empty array.' }. return @answer; }