in reply to Re^5: flip flop operator and if statement
in thread flip flop operator and if statement

it prints 3 for every iteration i.e.

#!/usr/bin/perl ##use warnings; while(<>){ if(($p=3)..5) { print "p is $p\n"; } }

p is 3

p is 3

p is 3

p is 3

p is 3

p is 3

p is 3

p is 3

p is 3

p is 3

p is 3

p is 3

p is 3

p is 3

p is 3

p is 3

p is 3

p is 3

p is 3

Replies are listed 'Best First'.
Re^7: flip flop operator and if statement
by LanX (Saint) on Sep 20, 2014 at 08:11 UTC
    In this code you are obviously always assigning 3.

    What's the problem?

    Cheers Rolf

    (addicted to the Perl Programming Language and ☆☆☆☆ :)

      Hi Rolf,

      i am trying to understand how these two statements

      if($p=3..5)

      vs

      if(($p=3)..5)

      are interpreted inside while loop of the code?

      Thanks
        athanasius already explained it in detail!