#!perl
use strict;
use warnings;
print "Content-Type: text/html\n\n";
print "
\n";
my @jobtypes = (32, 64, 64|128, 128|256, 64|256);
for my $j (@jobtypes) {
setBu($j);
}
print "";
sub setBu {
my $job_type = shift;
my %bj = (64,'D', 128,'A', 256,'H');
print "- Job type is $job_type:
\n";
foreach my $flag (keys %bj) {
my $bu = $bj{$flag} if ($flag & $job_type);
# But, somehow, I find that the bitwise & returns
# true for all the values! Hence the end result is not good.
# -- Does it?
if ($bu) {
print " - Bu is true for flag $flag
\n";
} else {
print " - Bu is false for flag $flag
\n";
}
}
print "
\n\n";
}