Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Difference between this array assignment and push

by rinceWind (Monsignor)
on May 16, 2007 at 14:37 UTC ( #615788=note: print w/ replies, xml ) Need Help??


in reply to Difference between this array assignment and push

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.

--
wetware hacker
(Qualified NLP Practitioner and Hypnotherapist)


Comment on Re: Difference between this array assignment and push

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://615788]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2014-07-12 11:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (239 votes), past polls