http://qs321.pair.com?node_id=723829


in reply to C-style for loop

Those 2 loops do quite different things.

If your goal is to create a new array, @cleaned_values, from another array, @values, you could use a "for" loop like this:

for (@values) { push @cleaned_values, _clean_cgi_param($_); }

Alternately, you could use map for this:

@cleaned_values = map { _clean_cgi_param($_) } @values;

Update: The code in the OP was modified after I composed this node.