develooper Front page | perl.perl5.porters | Postings from November 1999

problem with and (&) operator in perl5

Thread Next
From:
COLAPSO
Date:
November 23, 1999 02:25
Subject:
problem with and (&) operator in perl5
Message ID:
383A6AE4.20EB132@futurespace.es
Hi!,

    I have tested the same simple program in perl5 and perl4 with
different result:

The program, make an (bitwise) AND operation:
-------BEGIN----------
#!/usr/local/bin/perl
local($a);
local($b);
local($c);

$a = $ARGV[0];
$b = $ARGV[1];

print "$a-$b-\n";

$c = ($a & $b);

print "and= $c\n";
--------END-----------


The result in perl5:
$ and.pl 2 10
2-10-
and= 0

The result in perl4:
$ and.pl 2 10
2-10-
and= 2

the versions are:
* version 5.005_03 built for sun4-solaris
* Revision: 4.0.1.8 $$Date: 1993/02/05 19:39:30 $
Patch level: 36

Thanks,
    Edu



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About