Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Difference between this array assignment and push

by rinceWind (Monsignor)
on May 16, 2007 at 14:37 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://615788]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-04-24 22:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found