Why not initialise to undef then use unless (defined $array[$i])?
In reply to Re: Re: Array: inserting what isn't there by Bilbo in thread Array: inserting what isn't there by Anonymous Monk