我有一个迷人的控制器
$controller->render_to_string(json => { %{$hashref} });
# or
$controller->render_to_string(json => $hashref);
The $hashref
contains characters that are being escaped when written to the JSON object.
For example:
my $hashref = {
path => '/path/to/file'
}
输出为:
{
"path": "\\/path\\/to\\/file"
}
有没有办法通知render_to_string()
方法不要插值/转义这些值?
我应该提到的是,实际的字符串是MD5哈希.