in reply to perl behavior with print command

($note +=1) is an "lvalue" - i.e. a value that can be assigned to.

"0" (a constant) cannot be assigned to (It cannot take a different value), so perl complains.

Note "%=" is essentially an assignment operator.

        "Think of how stupid the average person is, and realize half of them are stupider than that." - George Carlin

Replies are listed 'Best First'.
Re^2: perl behavior with print command
by raghuprasad241 (Beadle) on Feb 17, 2016 at 17:19 UTC
    Thank you NetWallah. That explains the problem.
      next error will be print interpreted as a function.. because you have print (..) you can use the strange syntax print +(..) or the ugly print "",(..) one

      L*

      There are no rules, there are no thumbs..
      Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.