in reply to Best way to remove elem of for loop
Have a look at grep:
@ar = grep { -d $_ } @ar; [download]
Hmm, that's good. I had made the link between 'map' and 'grep' being similar, but it hadn't sunk in that you can apply an EXPR to grep, as well as a pattern.