On 4/25/07, Seanie <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to