Re: RegEx Substitution + Arrays On 4/25/07, Seanie  wrote:
> yitzle wrote:
> > What's the best way to apply a RegEx to an array? For loop?
> > @arr = qw/dc2ds reew12dsfa df2fdw/;
> > s/$find/$replace/ for(@arr);
>
> Yep, you can do that. Or use map()
>
> map(s/$find/$replace/, @arr);

You should not use map in a void context, it is bad form.

-- 
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/


