Help for this page

Select Code to Download


  1. or download this
    use strict;
    my $a = "0" . "1011";
    ...
    print $a & $b, "\n";#00011
    print $a | $b;#11011
    
  2. or download this
    use strict;
    print ord("0") & ord("0"), "\n";#48, which is "0"
    ...
    print ord("0") | ord("1"), "\n";#49, which is "1"
    print ord("1") | ord("0"), "\n";#49, which is "1"
    print ord("1") | ord("1"), "\n";#49, which is "1"
    
  3. or download this
    use strict;
    print ord("0") ^ ord("0"), "\n";#0, which is not "0"
    print ord("0") ^ ord("1"), "\n";#1, which is not "1"
    print ord("1") ^ ord("0"), "\n";#1, which is not "1"
    print ord("1") ^ ord("1"), "\n";#0, which is not "0"