in reply to Re^2: perl dancer route template hashref pass complex json file to server issue
in thread perl dancer route template hashref pass complex json file to server issue
Use a JSON library to generate JSON values (we almost always use JSON::XS). Generating a JSON value by hand is error prone, especially when you don't know how escape characters work in quotes in the language you are writing in.
#!/usr/bin/perl -l print qq<{"name":"jsonFileexample","problem":"thisIsThrProblem\"withCo +mma"}>;
for example, produces:
{"name":"jsonFileexample","problem":"thisIsThrProblem"withComma"}
- tye
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: perl dancer route template hashref pass complex json file to server issue (module)
by RamiD (Acolyte) on Jul 26, 2016 at 18:07 UTC | |
by tye (Sage) on Jul 26, 2016 at 18:30 UTC | |
by Anonymous Monk on Jul 26, 2016 at 18:49 UTC | |
by RamiD (Acolyte) on Jul 27, 2016 at 04:40 UTC | |
by tye (Sage) on Jul 28, 2016 at 04:44 UTC | |
by RamiD (Acolyte) on Jul 28, 2016 at 21:24 UTC | |
|
In Section
Seekers of Perl Wisdom