Help for this page

Select Code to Download


  1. or download this
    # this gives $result as 1, not 33.  Makes sense, 
    # since $val == 4 evaluates to 1.  But, I want $result to 
    ...
    $result = ($major_length == 4800) ? 18 
            : ($major_length ==  8552) 
                ? ($val == 4) : 33;
    
  2. or download this
        if ($major_length == 4800) {
            $result = 18;
    ...
        } else {
            # $result is Unspecified (see B below)
        }
    
  3. or download this
    $result = ($major_length == 4800)? 18:
              (($major_length == 8552)?
    ...
                            undef):        # see A above
                            undef);        # see B above