#!/usr/bin/perl # note that %b modifier processes binary. Similarly, %x processes hexadecimal and %o is for octal. use strict; use warnings; my ($move, $pos); $move = 0b1111111111111111; $pos = 0b0000111111111111; printf "%b\n", ($move ^ $pos);