65

Operators
Bitwise Operators

  • Perl provides access to bit-level operations on numeric values

      Operator Operation Example
      << Shift Left $i << 2;
      >> Shift Right $i >> 2;
      & AND $i = $i & 0x0f;
      | OR $i = $i | 1;
      ^ XOR $i = $i ^ 2;
      ~ NOT $i = $i ~ 1;