"be consistent" | |
PerlMonks |
Re: iterating through array and saving matches to new arrayby jazzfan (Novice) |
on Apr 15, 2018 at 20:05 UTC ( [id://1212946]=note: print w/replies, xml ) | Need Help?? |
Thanks POJ, et al. Let me abstract the problem to be sure I understand it: If I want to save matches to new array, and make it visible outside the foreach (or while, if, etc) then you are proposing not creating the block in the first place, and in cases where you have to use a code block, and return the new array, just use "my" and not "our" appears to be the take away.
In Section
Seekers of Perl Wisdom
|
|