Can someone please help to clarify? Also, please mention if there are other representation of "$|".
Thanks in advance.
There is no practical difference that I know of; $| only stores a boolean (0 or 1), so incrementing it will never result in any value other than 1. The micro-micro-optimizers might tell you that ++ is faster.
Decrementing it, on the other hand, acts as a toggle, but I can't think of any good reason to do that in production code: either you want it on or off.
$| is super magical, so that $|++ does the same as $| = 1; But why rely on magic when you can just do what you mean ($| = 1;)?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With