Help for this page

Select Code to Download


  1. or download this
    my $smallest = 1e308; 
    $smallest = $smallest < $_ ? $smallest : $_ for @array;
    
  2. or download this
    # Not a good example, but demonstrates the point
    $latest = $latest > time() ? $latest : time();
    
  3. or download this
    # This would be the same as a straight assignment, but '!=' is just a 
    +placeholder for a.n. other comparison operation.
    my $temp = function_with_side_effects();
    $state = $state != $temp ? $temp : $state;
    
  4. or download this
    my $smallest = 1e308;
    $smallest ?<:= $_ for @array;
    
    $latest ?>:= time;
    
  5. or download this
    $lvalue ?<:=  $rvalue; 
    $lvalue ?>:=  $rvalue; 
    ...
    $lvalue ?gt:= $rvalue; 
    $lvalue ?ge:= $rvalue; 
    $lvalue ?le:= $rvalue;