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

Comparing deliantra/Deliantra/Deliantra.pm (file contents):
Revision 1.52 by root, Mon Mar 20 02:15:36 2006 UTC vs.
Revision 1.53 by root, Wed Mar 22 03:32:09 2006 UTC

13use base 'Exporter'; 13use base 'Exporter';
14 14
15use Carp (); 15use Carp ();
16use File::Spec; 16use File::Spec;
17use List::Util qw(min max); 17use List::Util qw(min max);
18use Storable; 18use Storable qw(freeze thaw);
19 19
20our @EXPORT = qw( 20our @EXPORT = qw(
21 read_pak read_arch *ARCH TILESIZE $TILE *FACE editor_archs arch_extents 21 read_pak read_arch *ARCH TILESIZE $TILE *FACE editor_archs arch_extents
22); 22);
23 23
56 open my $fh, "<", $path 56 open my $fh, "<", $path
57 or die "$path: $!"; 57 or die "$path: $!";
58 binmode $fh; 58 binmode $fh;
59 local $/; 59 local $/;
60 60
61 Storable::thaw <$fh> 61 thaw <$fh>
62} 62}
63 63
64sub save_ref($$) { 64sub save_ref($$) {
65 my ($ref, $path) = @_; 65 my ($ref, $path) = @_;
66 66
67 open my $fh, ">", "$path~" 67 open my $fh, ">", "$path~"
68 or die "$path~: $!"; 68 or die "$path~: $!";
69 binmode $fh; 69 binmode $fh;
70 print $fh Storable::freeze $ref; 70 print $fh freeze $ref;
71 close $fh; 71 close $fh;
72 rename "$path~", $path 72 rename "$path~", $path
73 or die "$path: $!"; 73 or die "$path: $!";
74} 74}
75 75

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines