in reply to remove whitespace from an array

I think you are looking at two different things here, firstly if you print @array as:

print "@array";
you will get the elements of @array separated by the value of $" (aka $LIST_SEPARATOR if using the English module). so you can do:
local $" = ''; print "@array";
will not output the spaces - of course in this simple case you can simply omit the double quotes and the items will not be separated, I am assuming you are interpolating into a larger quoted string.

If you want to remove any array elements that comprise only whitespace you can use grep :

@array = grep !/^\s+$/, @array;
You could also use map to strip leading or trailing whitespace from the elements:
@code = map { s/^\s+//; s/\s+$//; $_ } @array;
and so forth.

/J\