Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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 wandering the Monastery: (6)
As of 2014-12-28 10:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (180 votes), past polls