$keys = join '|', # 4 map { quotemeta } # 3 sort { length($b) <=> length($a) } # 2 keys %change; # 1