Perl-Sensitive Sunglasses | |
PerlMonks |
flip flop operator and if statementby iThunder (Beadle) |
on Sep 20, 2014 at 02:32 UTC ( [id://1101323]=perlquestion: print w/replies, xml ) | Need Help?? |
iThunder has asked for the wisdom of the Perl Monks concerning the following question: Hello, Can someone please help that how value of p is coming out as 1 through 17. My understanding is p should be equal to $. (line number) and it should be printed from 3 to 19 rather 1 to 17.Thanks in advance!
When i run the same code on a file that has fifteen lines, it returns following p is 1 p is 2 p is 3 p is 4 p is 5 p is 6 p is 7 p is 8 p is 9 p is 10 p is 11 p is 12 p is 13 p is 14 p is 15 p is 16 p is 17 Also what is difference when i have $p=3..1 vs ($p=3)..1 in if statement above
Back to
Seekers of Perl Wisdom
|
|