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

Re: Question on Reading a file inside while and counting no.of lines

by golux (Hermit)
on Jun 15, 2013 at 21:16 UTC ( #1039156=note: print w/replies, xml ) Need Help??


in reply to Question on Reading a file inside while and counting no.of lines

vyeddula,

There's a difference between $count++ and ++$count.

The first one increments it after using it (ie. prints its value first, and then adds one). The second increments it before using it.

Try using ++$count instead, and you should see the answer you expect.

Look at the first example in "Auto-increment and Auto-decrement" here.

say  substr+lc crypt(qw $i3 SI$),4,5

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1039156]
help
Chatterbox?
[erix]: I'll keep that in mind (haven't read), buona notte :)
[Discipulus]: oh erix but is the fourth of cycle;read them in order
[erix]: hm, perhaps I can just read it here
Discipulus zzz...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2017-05-23 20:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?