##
$other = "x!4Y";
$password = $PATTERN; # $PATTERN is aHINTbcd
$password =~ tr/abcd/$other/;
####
$password = substr($other, 0, 1).$HINT.substr($other, 1, 3);
####
$password = join('', substr($other, 0, 1), $HINT, substr($other, 1, 3));