ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/utils/regiontree
(Generate patch)

Comparing deliantra/server/utils/regiontree (file contents):
Revision 1.2 by root, Wed Jan 24 22:46:02 2007 UTC vs.
Revision 1.3 by root, Wed Jan 24 22:46:38 2007 UTC

1#!/opt/perl/bin/perl 1#!/opt/perl/bin/perl
2 2
3# usage: regiontree < maps/regions 3# usage: regiontree maps/regions
4 4
5my %regions; 5my %regions;
6 6
7sub print_rec { 7sub print_rec {
8 my ($reg, $pad) = @_; 8 my ($reg, $pad) = @_;
12 } 12 }
13} 13}
14 14
15 15
16my $curreg = ''; 16my $curreg = '';
17while (<STDIN>) { 17while (<>) {
18 if (/^region\s*(\S+)\s*$/) { 18 if (/^region\s*(\S+)\s*$/) {
19 $curreg = $1; 19 $curreg = $1;
20 $regions{$curreg} = {}; 20 $regions{$curreg} = {};
21 } elsif (/^parent\s*(\S+)\s*$/) { 21 } elsif (/^parent\s*(\S+)\s*$/) {
22 $regions{$1} = {} unless exists $regions{$1}; 22 $regions{$1} = {} unless exists $regions{$1};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines