From 05752dc149a35bc0095647ad3c357f62a857722d Mon Sep 17 00:00:00 2001 From: miker Date: Thu, 25 Aug 2005 21:29:26 +0000 Subject: [PATCH] protect hash keys by quoting git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@506 9efc2488-bf62-4759-914b-345cdb29e865 --- src/perlmods/JSON.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/perlmods/JSON.pm b/src/perlmods/JSON.pm index 13db444..a43f48f 100644 --- a/src/perlmods/JSON.pm +++ b/src/perlmods/JSON.pm @@ -196,7 +196,7 @@ sub perl2JSON { for my $key (sort keys %$perl) { $output .= ',' if ($c); - $output .= perl2JSON(undef,$key, $strict).':'.perl2JSON(undef,$$perl{$key}, $strict); + $output .= '"'.$key.'":'.perl2JSON(undef,$$perl{$key}, $strict); $c++; } $output .= '}'; -- 2.11.0