Have a look at grep:
@ar = grep { -d $_ } @ar; [download]
In reply to Re: Best way to remove elem of for loop by hdb in thread Best way to remove elem of for loop by HarryPutnam