in reply to
Re^2: Bitwise Operator Error
in thread Bitwise Operator Error
bigint basically turns every number into an object which acts as a number. Limit the scope of bigint using curlies, or create the objects yourself were needed.
#!/usr/bin/perl -w
# File displayPipeTracer2.pl
{
# Only makes objects from numbers in these curlies
use bigint;
my $testString = " 00008008 000000FF 00800000";
$testString =~ s/\s+//g;
$testString = Math::BigInt->new("0x$testString");
my $maskResult = $testString & 0x400000000000000000000000;
print "Mask Result: $maskResult\n";
}
#!/usr/bin/perl -w
# File displayPipeTracer2.pl
my $testString = " 00008008 000000FF 00800000";
$testString =~ s/\s+//g;
$testString = Math::BigInt->new("0x$testString");
my $mask = Math::BigInt->new('0x400000000000000000000000');
my $maskResult = $testString & $mask;
print "Mask Result: $maskResult\n";