Help for this page

Select Code to Download


  1. or download this
    my $rain = 1;
    my %Weather = (
        'precipitation' => ($rain == 0) ? 'dry' : 'wet',
    );
    
  2. or download this
    my $rain = 1;
    my %Weather = (
        'precipitation' => $rain ? 'wet' : 'dry',
    );
    
  3. or download this
    my $precipitation;
    if ($rain == 0) {
    ...
    elsif ($rain == 1) {
        $precipitation = 'wet';
    }