my ($x, $y) = mysub(); if (defined $x and defined $y) { # do stuff... } else { #returned single zero. # do other stuff... }