Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: map versus for

by dreadpiratepeter (Priest)
on Aug 04, 2008 at 15:28 UTC ( [id://702088]=note: print w/replies, xml ) Need Help??


in reply to Re: map versus for
in thread map versus for

Oh definately, because once you put more than one statement into a map, you have violated a bigger stylistic rule.
In that case, I will either pull the logic into a subroutine and call it from the map (assuming that I may need to reuse it), or switch to a for loop.
actually, I will switch to a foreach loop. I find that always using foreach for the
for $var (@list)
form and for for the c-style form adds to the grokiness of my code.
UPDATE: should have looked closer at the body of the for there, I agree with Fletch on that one


-pete
"Worry is like a rocking chair. It gives you something to do, but it doesn't get you anywhere."

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://702088]
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: (4)
As of 2024-04-23 18:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found