protect hash keys by quoting
authormiker <miker@9efc2488-bf62-4759-914b-345cdb29e865>
Thu, 25 Aug 2005 21:29:26 +0000 (21:29 +0000)
committermiker <miker@9efc2488-bf62-4759-914b-345cdb29e865>
Thu, 25 Aug 2005 21:29:26 +0000 (21:29 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@506 9efc2488-bf62-4759-914b-345cdb29e865

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 .= '}';