ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC.pm (file contents):
Revision 1.158 by root, Wed Nov 14 23:50:29 2007 UTC vs.
Revision 1.159 by root, Wed Dec 5 10:51:53 2007 UTC

28use AnyEvent (); 28use AnyEvent ();
29use Pod::POM (); 29use Pod::POM ();
30use File::Path (); 30use File::Path ();
31use Storable (); # finally 31use Storable (); # finally
32use Fcntl (); 32use Fcntl ();
33use JSON::XS qw(to_json from_json); 33use JSON::XS qw(encode_json decode_json);
34 34
35=item guard { BLOCK } 35=item guard { BLOCK }
36 36
37Returns an object that executes the given block as soon as it is destroyed. 37Returns an object that executes the given block as soon as it is destroyed.
38 38
165 if ($CFG =~ /^---/) { ## TODO compatibility cruft, remove 165 if ($CFG =~ /^---/) { ## TODO compatibility cruft, remove
166 require YAML; 166 require YAML;
167 utf8::decode $CFG; 167 utf8::decode $CFG;
168 $::CFG = YAML::Load ($CFG); 168 $::CFG = YAML::Load ($CFG);
169 } elsif ($CFG =~ /^\{/) { 169 } elsif ($CFG =~ /^\{/) {
170 $::CFG = from_json $CFG; 170 $::CFG = decode_json $CFG;
171 } else { 171 } else {
172 $::CFG = eval $CFG; ## todo comaptibility cruft 172 $::CFG = eval $CFG; ## todo comaptibility cruft
173 } 173 }
174} 174}
175 175
178 178
179 $::CFG->{VERSION} = $::VERSION; 179 $::CFG->{VERSION} = $::VERSION;
180 180
181 open my $fh, ">:utf8", $file 181 open my $fh, ">:utf8", $file
182 or return; 182 or return;
183 print $fh to_json $::CFG; 183 print $fh encode_json $::CFG;
184} 184}
185 185
186sub http_proxy { 186sub http_proxy {
187 my @proxy = win32_proxy_info; 187 my @proxy = win32_proxy_info;
188 188

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines