On Tue, 24 Sep 2002, David Samuelsson (PAC) wrote:
> I have an array with a lot of data.
>
> i want to remove certain elements from it:
> so i ran:
> for (@array){
> s/$current_user.*//;
> }
>
> nw when i print it, all $current user are gone as i wanted, but its a big space in
>the array instead.
> like:
>
> user1
> user1
> user2
> user2
>
>
>
> user4
> user4
> user4
> etc..
>
> how do i get the array to be without the spaces, i tried to remove all whitespaces
>with s/\s+/, that didnt seem to work, any ideas?
>
@array = grep !/^\s*$/, @array;
This will return an array of elements (removing all elements that are either filled
with spaces or are blank)
George.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]