use Digest::MD5 'md5_hex';
my ($user, $domain, $password) = @ARGV;
my $digest = md5_hex("$user:$domain:$password");
print "Digest = $digest\n";
You need to include the username, domain, and password, in that order, separated by colons.
If the digest were just of the password, someone could create digests of all dictionary words and use them to find out the passwords of all users at the same time. By including the user name, you have to do the dictionary attack separately for each user.
Including the domain helps to protect users who have passwords on several systems, or generic user names like "root", "apache", etc.