1IP::Geolocation::MMDB::UMseetradCaotnat(r3i)buted Perl DIoPc:u:mGeenotlaotciaotnion::MMDB::Metadata(3)
2
3
4
6 IP::Geolocation::MMDB::Metadata - Metadata from a MaxMind DB file
7
9 version 1.010
10
12 use IP::Geolocation::MMDB;
13 my $db = IP::Geolocation::MMDB->new(file => 'City.mmdb');
14 my $metadata = $db->metadata;
15
17 A class for metadata from a MaxMind DB file.
18
20 new
21 my $metadata = IP::Geolocation::MMDB::Metadata->new(
22 binary_format_major_version => 2,
23 binary_format_minor_version => 0,
24 build_epoch => time,
25 database_type => 'City',
26 languages => [qw(en fr pt-BR)],
27 description => {
28 en => 'IP to city',
29 fr => 'IP vers ville',
30 },
31 ip_version => 6,
32 node_count => 3829268,
33 record_size => 28,
34 );
35
36 Returns a new metadata object.
37
38 binary_format_major_version
39 my $major_version = $metadata->binary_format_major_version;
40
41 Returns the database format's major version number.
42
43 binary_format_minor_version
44 my $minor_version = $metadata->binary_format_minor_version;
45
46 Returns the database format's minor version number.
47
48 build_epoch
49 my $t = gmtime $metadata->build_epoch;
50
51 Returns the database's build timestamp as an epoch number.
52
53 database_type
54 my $database_type = $metadata->database_type;
55
56 Returns a free-form string indicating the database type.
57
58 languages
59 for my $language (@{$metadata->languages}) {
60 say $language;
61 }
62
63 Returns a reference to an array of locale codes indicating what
64 languages this database has information for.
65
66 description
67 my %description_for = %{$metadata->description};
68 for my $language (keys %description_for) {
69 my $description = $description_for{$language};
70 say "$language: $description";
71 }
72
73 Returns a reference to a hash that maps locale codes to strings that
74 describe the database content.
75
76 ip_version
77 my $ip_version = $metadata->ip_version;
78
79 Returns 4 or 6.
80
81 node_count
82 my $node_count = $metadata->node_count;
83
84 Returns the number of nodes in the database's search tree.
85
86 record_size
87 my $record_size = $metadata->record_size;
88
89 Returns the record size for nodes in the database's search tree.
90
92 None.
93
95 None.
96
98 None.
99
101 None.
102
104 None known.
105
107 IP::Geolocation::MMDB
108
110 Andreas Vögele <voegelas@cpan.org>
111
113 Copyright (C) 2022 Andreas Vögele
114
115 This module is free software; you can redistribute it and/or modify it
116 under the same terms as Perl itself.
117
118
119
120perl v5.38.0 2023-07-20IP::Geolocation::MMDB::Metadata(3)