There's more than one way to do things | |
PerlMonks |
Re: Difference between this array assignment and pushby rinceWind (Monsignor) |
on May 16, 2007 at 14:37 UTC ( [id://615788]=note: print w/replies, xml ) | Need Help?? |
I would go with the first approach as it's much clearer what you are doing. In the second case, @pics may have some previous contents that you are adding to. The code is iterating matches in a while loop; there's no reason to see why this would ever be better than picking up all matches as a list and assigning or pushing them to the array. --
In Section
Seekers of Perl Wisdom
|
|