in reply to Re^2: Converting hash into js object properties
in thread Converting hash into js object properties
my %hash = ( rules => {name => '"required"', ...Just tried that but the property keys get surrounded by quotes in the JSON output.
The module is just faithfully converting your Perl data structure into a JSON one. Your Perl strings contain the double quotes, so the JSON ones do too. If you don't want that, strip the double quotes from the Perl strings before converting to JSON (or don't add them in the first place).
Update: Sorry, I thought you were talking about the extra quotes in the values, but you meant the keys. See replies below.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Converting hash into js object properties
by nysus (Parson) on Nov 21, 2017 at 16:26 UTC | |
by haukex (Archbishop) on Nov 21, 2017 at 16:35 UTC | |
by nysus (Parson) on Nov 21, 2017 at 16:40 UTC | |
by haukex (Archbishop) on Nov 21, 2017 at 16:49 UTC | |
by nysus (Parson) on Nov 21, 2017 at 17:04 UTC | |
| |
by nysus (Parson) on Nov 21, 2017 at 16:57 UTC | |
by Your Mother (Archbishop) on Nov 21, 2017 at 16:48 UTC |