protect hash keys by quoting
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 25 Aug 2005 21:29:26 +0000 (21:29 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 25 Aug 2005 21:29:26 +0000 (21:29 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1745 dcc99617-32d9-48b4-a31d-7c20da2025e4

OpenSRF/src/perlmods/JSON.pm

index 13db444..a43f48f 100644 (file)
@@ -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 .= '}';