my $y = $x =~ s/([0-9a-fA-F]{2}):?/chr(hex($1))/egr; # 5.14+ required