IF statements

#!/usr/local/bin/perl
print ("Enter the dividend (number to divide):\n");
$dividend = <STDIN>;
chop ($dividend);
print ("Enter the divisor (number to divide by):\n");
$divisor = <STDIN>;
chop ($divisor);
if ($divisor == 0) {
        print ("Error: can't divide by zero!\n");
} elsif ($dividend == 0) {
        $result = 0;
} elsif ($divisor == 1) {
        $result = $dividend;
} else {
        $result = $dividend / $divisor;
}
if ($divisor == 0) {
        # skip the print, since we detected an error
} else {
        print ("The result is ", $result, "\n");
}