Help for this page

Select Code to Download


  1. or download this
    my $var;
    if($cond) {
    ...
    } else {
        $var = 'that';
    }
    
  2. or download this
    my $var = $cond ? 'this' : 'that';
    
  3. or download this
    $var = $var ? 'this' : 'that';
    
  4. or download this
    $value = $value * 5;
    $next  = $next + 1;
    
  5. or download this
    $value *= 5;
    $next++;
    
  6. or download this
    $result = build_shed(
        logs   => 24,
       (screws => 120) x!! @screwdrivers,
       (nails  => 360) x!! @hammers,
    );
    
  7. or download this
    my %materials = (logs => 24);
    $materials{screws} = 120 if @screwdrivers;
    $materiasl{nails}  = 360 if @hammers;
    $result = build_shed(%materials);
    
  8. or download this
    $var = $var ? 'this' : 'that';
    
  9. or download this
    $var ?= 'this' : 'that';