Help for this page

Select Code to Download


  1. or download this
    my $min = ( $x < $min ) ? $x : $min;
    
  2. or download this
    #! perl -slw
    use strict;
    ...
            : $_ == 2 ? 'two'
            : 'three';
    }
    
  3. or download this
    my $var;
    if( <cond1> ) {
    ...
    else {
        $var = <default>;
    }
    
  4. or download this
    my $var;
    if( <cond1> ) {
    ...
    else {
        $var = <default>;
    }
    
  5. or download this
    my $var = <cond1> ? <somevalue>
            : <cond2> ? <someothervalue>
    ...
    
    doSomething     if $var == <somevalue>;
    doSomethingElse if $var == <someothervalue>;
    
  6. or download this
    my $var = ......;
    
  7. or download this
    my $var;
    
    ...
    else {
       $var = ...;
    }