Help for this page

Select Code to Download


  1. or download this
    my $message = $status == 2 ? 'HIGH' 
                : $status == 1 ? 'MODERATE'
                : 'LOW'
    
    print $message
    
  2. or download this
    my %status_message = { 2 => 'HIGH', 1=>'MODERATE', 0=>'LOW' };
    my $message = $status_message{ $status } || 'LOW';
    
  3. or download this
    my @status_messages = qw( LOW MODERAGE HIGH );
    my $message = $status_messages[$status] || 'LOW';