($net eq $x) ? 1 : 0; is the same as if ($net eq $x) { return 1; } else { return 0; }