Help for this page

Select Code to Download


  1. or download this
    sub DefaultHashValue {
        my %h = @_;
    ...
        my @k = sort values %h;
        return $r{ $k[0] }
    }
    
  2. or download this
    sub sort_keys {
        my %h = @_;
        my @s = sort { $h{$a} cmp $h{$b} } keys %h;
        return $s[0]
    }
    
  3. or download this
    sub min {
        my %h = @_;
    ...
        $h{$_} lt $h{$min} and $min = $_ for keys %h;
        return $min
    }
    
  4. or download this
    #!/usr/bin/perl
    use warnings;
    ...
                   min  => sub { min(%h)  },
                 });
    }