in reply to my 'if' condition doesn't work, why?

The particular expression  (40||47||76) evaluates only to one value: 40. That's because of the nature of the logical-or operator; see perlop. Maybe try something like:

c:\@Work\Perl\monks>perl -wMstrict -le "my %hit = map { $_ => 1 } 40, 47, 76; ;; for (my $n = 0; $n < 268; $n++) { if ($hit{$n}) { print $n; } } " 40 47 76

Update: Or even with a more Perlish for-loop:

c:\@Work\Perl\monks>perl -wMstrict -le "my %hit = map { $_ => 1 } 40, 47, 76; ;; for my $n (0 .. 267) { if ($hit{$n}) { printf qq{$n }; } } " 40 47 76