use strict; use warnings; sub test { undef; } my @a = test; if (@a) { use Data::Dumper; print Dumper \@a; } __END__ $VAR1 = [ undef ];