Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: Looping through a file, reading each line, and adding keys/editing values of a hash

by Kenosis (Priest)
on Dec 06, 2013 at 16:48 UTC ( #1066008=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Looping through a file, reading each line, and adding keys/editing values of a hash
in thread Looping through a file, reading each line, and adding keys/editing values of a hash

Interesting question.

One reason is that the OP already attempted a post-increment, and since the two increment types would produce the same outcome, why make the change?

Another reason is my personal preference for this counting situation. If, for example, I were on a sidewalk, tallying all the red cars that passed by, I wouldn't make a tally mark upon their approach (pre-increment), but rather after they crossed an imaginary line extending across the street from my position (post-increment).

Perhaps this ultimately boils down to personal preference, in cases like these...


Comment on Re^3: Looping through a file, reading each line, and adding keys/editing values of a hash

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2015-07-04 09:22 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 (59 votes), past polls