$s = join('|', map { local $_=$_; s/\^/^1/g; s/\|/^2/g; $_ } %test_hash );