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

Tip #6 from the Basic debugging checklist: B::Deparse

UNTESTED:

for (my $n = 0; $n < 268; $n++) { if ($n==40 || $n==47 || $n==76)) { print $n."\n"; } }

Another conventional, scalable way is to store your values in a hash and use exists.