It works because it is perfectly correct syntax. There is nothing wrong with it at all.

You will see this syntax used frequently, and it is actually good programming style.

Quote:

but It's quite pointless as it results in any case true



No, for a Win9x or NT box the expression will of course evaluate to "0", which is what it required.

As a personal preference I'd use parentheses to highlight the sub-expressions and ensure correct parsing. I might also use the bitwise "|" but in fact the logical "OR" is more correct in this case:
Code:
$w2kwxp = (@PRODUCTTYPE = "Windows 2000 Professional") | (@PRODUCTTYPE = "Windows XP Professional")



Other languages like 'C' have seperate assignment ('x=0') and equivalent ('if(x==0)') operators because it is not always possible to determine from context whether the expression is assignment or syntax.

This is a good example of how it can be ambiguous, but fortunately the KiXtart parser makes the right choice.