if( defined $array[2] and $array[2] ne '' ){ # mach was wenn $array[2] ein Leerer String ist. }