Help for this page

Select Code to Download


  1. or download this
    use Digest::MD5 qw(md5_hex);
    use strict; 
    use warnings;
    
    my $secret = "applepie";
    
  2. or download this
    sub get_md5 
    {
     md5_hex("$secret" . "$_")
    };
    
  3. or download this
    my @array          = qw(foo bar baz);
    my %md5_other_hash = (map {&get_md5, $_ } @array);
    
  4. or download this
    my %md5_hash       = ( &get_md5('foo')  => "foo",
                           &get_md5('bar')  => "bar",
                           &get_md5('bar')  => "baz",
    );
    
  5. or download this
    print &get_md5('foo');