in reply to Re^2: Code clarification - use of map and $$_
in thread Code clarification - use of map and $$_
without digging too deep into this code ...
map can only iterate over scalars.
I.e. like a list of $array_refs, if you want to address different arrays ...
> Why not direct access to the variable?
if you mean something like @array as the "direct" variable, you CAN'T do something like
map { $_[0]++ } (@a,@b,@c)
to increment the first element of each array.
The real problem with that code is the laziness of the author to use a clear style.
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!
|
|---|