If you run it with strict:
perl -Mstrict -e 'if(true) { print 1 }'
you would get the reason:
Bareword "true" not allowed while "strict subs" in use at -e line 1.
It is interpreted as string "true"
or "false"
which is always true. The constants are not defined in Perl, but you can do it yourself:
use constant { true => 1, false => 0 };
if(false) { print 1 }