my @array = grep{defined $_}@array;