say JSON->new->escape_slash()->encode({foo => 'b/ar'}) eq '{"foo":"b\\/ar"}' ? 'klappt' : 'fail';