remove any leading ::ffff: on ipv4 addresses
[spider.git] / perl / create_usdb.pl
1 #!/usr/bin/env perl
2 #
3 # create a USDB file from a standard raw file (which is GZIPPED BTW)
4 #
5 # This will overwrite and remove any existing usdb file, but it will 
6 # copy the old one first and update that.
7 #
8
9 use strict;
10
11 # make sure that modules are searched in the order local then perl
12 BEGIN {
13         # root of directory tree for this system
14         use vars qw($root);
15         
16         $root = "/spider"; 
17         $root = $ENV{'DXSPIDER_ROOT'} if $ENV{'DXSPIDER_ROOT'};
18
19         unshift @INC, "$root/perl";     # this IS the right way round!
20         unshift @INC, "$root/local";
21         
22 }
23
24 use DXVars;
25 use SysVar;
26 use USDB;
27
28 die "no input (usdbraw?) files specified\n" unless @ARGV;
29
30 print "\n", USDB::load(@ARGV), "\n";
31 exit(0);
32
33