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

Re: Scalar assignment with loop iterator considered bad?

by Adam (Vicar)
on Jul 22, 2005 at 19:30 UTC ( #477324=note: print w/ replies, xml ) Need Help??


in reply to Scalar assignment with loop iterator considered bad?

In this particular scenario, I'd use join(). Why write code to do what a native perl function will do for you? From a functionality perspective, letting join() do the work is probably better than concatenating a bunch of stuff in a loop. I'm sure you could come up with some example where looping was better - if, say, you were doing other stuff at the same time.


Comment on Re: Scalar assignment with loop iterator considered bad?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (11)
As of 2015-07-03 11:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (51 votes), past polls