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.1 by elmex, Wed Jan 24 14:50:16 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
3# usage: regiontree maps/regions
2 4
3my %regions; 5my %regions;
4 6
5sub print_rec { 7sub print_rec {
6 my ($reg, $pad) = @_; 8 my ($reg, $pad) = @_;
10 } 12 }
11} 13}
12 14
13 15
14my $curreg = ''; 16my $curreg = '';
15while (<STDIN>) { 17while (<>) {
16 if (/^region\s*(\S+)\s*$/) { 18 if (/^region\s*(\S+)\s*$/) {
17 $curreg = $1; 19 $curreg = $1;
18 $regions{$curreg} = {}; 20 $regions{$curreg} = {};
19 } elsif (/^parent\s*(\S+)\s*$/) { 21 } elsif (/^parent\s*(\S+)\s*$/) {
20 $regions{$1} = {} unless exists $regions{$1}; 22 $regions{$1} = {} unless exists $regions{$1};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines