Help for this page

Select Code to Download


  1. or download this
    my $n = 3;
    
    ...
          :           'ETOOBIG';
    
    print "$n : $s\n"; # 3 : three
    
  2. or download this
    my %h = ( 1 => 'one', 2 => 'two', 3 => 'three', 4 => 'four' );
    
     $s = $h{$n} // 'ETOOBIG'; # needs perl 5.10
    #$s = $h{$n} || 'ETOOBIG'; # works for any perl
    print "$n : $s\n"