<p>My list (@degree) is built from a SQL command. The NVL command in the SQL isn't working, neither are tests such as:</p>

<pre><code>if (@degree[$i] == "")
if (@degree[$i] == " ")
if (@degree[$i] == '')
if (@degree[$i] == -1)
if (@degree[$i] == 0)
if (@degree[$i] == ())
if (@degree[$i] == undef)
</code></pre>

<p>$i is a counter variable in a for loop. Basically it goes through and grabs unique degrees from a table and ends up creating <code>("AFA", "AS", "AAS", "", "BS")</code>. The list is not always this long, and the empty element is not always in that position 3.</p>

<p>Can anyone help?</p>

<p>I want to either test during the for loop, or after the loop completes for where this empty element is and then replace it with the word, "OTHER".</p>

<p>Thanks for anything
-Ken</p>

First of all, the ith element in an array is $degree[$i], not @degree[$i].  Second, "==" is for numerical comparisons - use "eq" for lexical comparisons.  Third of all, try
```
if (defined($degree[$i]))
```