<p>When I am running the following statement:</p>

<pre><code>@filtered = map {s/&amp;nbsp;//g} @outdata;
</code></pre>

<p>it is returning an empty list instead of the filtered list that I expected.  What I am trying to do is remove every occurrence of <code>&amp;nbsp;</code> from an array of string (which is an XML file).</p>

<p>Obviously, I am not understanding something.  Can anyone tell me the correct way to do this might be, and why this isn't working for me as is?</p>

Try this:
```
```
@filtered = map {s/&nbsp;//g; $_} @outdata;
```
```
The problem is the s operator in perl modifies $_ but actually returns the number of changes it made. So, the extra $_ at the end causes perl to return the modified string for each element of @outdata.