ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/Util.pm
Revision: 1.1
Committed: Fri Apr 7 16:04:03 2006 UTC (18 years, 1 month ago) by elmex
Branch: MAIN
Log Message:
added config stuff

File Contents

# Content
1 package Client::Util;
2
3 sub read_cfg {
4 my ($file) = @_;
5
6 open CFG, $file
7 or return;
8
9 $::CFG = eval join '', <CFG>;
10
11 close CFG;
12 }
13
14 sub write_cfg {
15 my ($file) = @_;
16
17 open CFG, ">$file"
18 or return;
19
20 {
21 local $Data::Dumper::Purity = 1;
22 $::CFG->{VERSION} = $::VERSION;
23 print CFG Data::Dumper->Dump ([$::CFG], [qw/CFG/]);
24 }
25
26 close CFG;
27 }
28
29 1;