$, = $/; undef @a[<>]; print grep exists $a[$_], $[ .. $#a;