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