in reply to map {} list or do {} for list?
map returns a list. It should be used when you want the list being generated as output.
do{...} for should be used when you just want to do things in a loop.
Since you have your statement in void context, you obviously don't want any output. Thus, the for loop is what you want.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: map {} list or do {} for list?
by Random_Walk (Prior) on Apr 11, 2014 at 15:27 UTC | |
by SuicideJunkie (Vicar) on Apr 11, 2014 at 16:06 UTC | |
by choroba (Cardinal) on Apr 11, 2014 at 16:08 UTC | |
by Anonymous Monk on Apr 11, 2014 at 16:44 UTC | |
by SuicideJunkie (Vicar) on Apr 14, 2014 at 14:30 UTC | |
by jethro (Monsignor) on Apr 15, 2014 at 09:30 UTC | |
by Random_Walk (Prior) on Apr 12, 2014 at 12:33 UTC |
In Section
Seekers of Perl Wisdom