in reply to Re^3: Forking sub inside a module
in thread Forking sub inside a module

Maybe it's just me, but I find
while (wait != -1) {}
more natural than
while (-1 != wait) {}
since 'wait' is what I want to check :o)

-- Time flies when you don't know what you're doing

Replies are listed 'Best First'.
Re^5: Forking sub inside a module
by admiral_grinder (Pilgrim) on Jun 16, 2009 at 13:20 UTC
    It helps to debug typo mistakes (language independent). If you was doing a regular compare '==' but used '=' instead, then 'wait = -1' will assign -1 to wait which could cause run time problems later on. However, if you do '-1 = wait' the compiler will throw a syntax error because you are trying change a constant.
      Good point, except you "can't modify wait in scalar assignment" either, or atleast that's what perl says when I try.
      For variables though, I see what you mean.

      -- Time flies when you don't know what you're doing