my $one = 1; my $zero = 0; my $undef; my $result; $result = 1; # 1 $result = 1 || 0; # also 1 $result = 0 || 1; # also 1 $result = $zero || $one; # also 1 $result = $zero // $one; # 0 $result = $zero // 1; # 0 as well $result = 0 // 1; # 0 as well $result = $undef // $one; # 1 again $result = $undef || $one; # 1 again $result = fork || die; # dies in the child process or if failing to fork $result = fork && die; # dies in the parent process $result = fork // die; # dies in process unable to fork a child # (beware the return values of function calls, for they are subtle and quick to bite your behind)