use constant NOT1 => ~ 1; print "~1 is " . NOT1 . "\n"; if(NOT1 !=~ 1) { print "Different (huh?!?)\n"; } else { print "The same (of course!)\n"; }