my $n = 534587; print "even\n" if($n % 2 == 0); # modulo operator of possibly a float or possibly an integer (*) #### use integer; my $n = 534587; print "even\n" if($n & 1 == 0); # checking LSB with Bitwise And on an integer #### my $n = "534587"; print "even\n" if($n =~ /[02468]$/); # reg exp #### my $n = "534587"; my $c = substr($n, -1, 1); # last char print "even\n" if ( ($c == '0') || ($c == '2') || ($c == '4') || ($c == '6') || ($c == '8') ); # no regexp