IP::Ge...etadata(3pm)
π IP::Geolocation::MMDB::Metadata β the vibe β¨
okay so bestie, welcome to IP::Geolocation::MMDB::Metadata, a Perl module (manual section 3pm, iykyk) that hands you the metadata from a MaxMind DB file. it's giving backstage pass to the database's own little ID card π
π VERSION
version 1.013
β¨ SYNOPSIS
use IP::Geolocation::MMDB;
my $db = IP::Geolocation::MMDB->new(file => '/path/to/City.mmdb');
my $metadata = $db->metadata;
like. that's it. that's the whole entrance exam π¦
πΈ DESCRIPTION
A class for metadata from a MaxMind DB file. she's the metadata girlie. she knows things about the database. she's not the database, she's the about the database β¨
π SUBROUTINES/METHODS
π new
my $metadata = IP::Geolocation::MMDB::Metadata->new(
binary_format_major_version => 2,
binary_format_minor_version => 0,
build_epoch => time,
database_type => 'City',
languages => [qw(en fr pt-BR)],
description => {
en => 'IP to city',
fr => 'IP vers ville',
},
ip_version => 6,
node_count => 3829268,
record_size => 28,
);
Returns a new metadata object. literally manifesting a metadata object into existence, no cap π
πΈ binary_format_major_version
my $major_version = $metadata->binary_format_major_version;
Returns the database format's major version number. the big number. the main character number. π
π¦ binary_format_minor_version
my $minor_version = $metadata->binary_format_minor_version;
Returns the database format's minor version number. the supporting role that still ate π
β build_epoch
my $t = gmtime $metadata->build_epoch;
Returns the database's build timestamp as an epoch number. yes bestie, an epoch number β that's raw seconds, you gotta gmtime it yourself if you want something human-readable. the gmtime in the example is doing the heavy lifting there π°οΈ
π database_type
my $database_type = $metadata->database_type;
Returns a free-form string indicating the database type. free-form! so she can say whatever she wants. unhinged queen π
π§ languages
for my $language (@{$metadata->languages}) {
say $language;
}
Returns a reference to an array of locale codes indicating what languages this database has information for. note the @{$...} deref, because she hands you a reference to an array, not a plain array. multilingual icon π
π description
my %description_for = %{$metadata->description};
for my $language (keys %description_for) {
my $description = $description_for{$language};
say "$language: $description";
}
Returns a reference to a hash that maps locale codes to strings that describe the database content. again: a reference, this time to a hash, so deref with %{$...} like the example does. she's describing herself in every language she knows, and honestly? relatable πΈ
π ip_version
my $ip_version = $metadata->ip_version;
Returns 4 or 6. that's the whole menu. pick your fighter π₯
π node_count
my $node_count = $metadata->node_count;
Returns the number of nodes in the database's search tree. she counted. she's thorough. respect π³
π record_size
my $record_size = $metadata->record_size;
Returns the record size for nodes in the database's search tree. nodes got a size and she's reporting it fr fr π
π DIAGNOSTICS
None. zero drama. no errors, no warnings, nothing to worry about π«Ά
π₯ CONFIGURATION AND ENVIRONMENT
None. she does not read your environment variables. she does not want your environment variables. she's low maintenance β¨
π§ DEPENDENCIES
None. she stands on her own two feet, self-made queen π
π INCOMPATIBILITIES
None. she gets along with everybody π
π BUGS AND LIMITATIONS
None known. as far as anyone can tell, she's flawless. (as far as anyone can tell!! π)
πΈ SEE ALSO
IP::Geolocation::MMDBβ her parent, her origin story, her whole world
β AUTHOR
Andreas VΓΆgele <voegelas@cpan.org>
π LICENSE AND COPYRIGHT
Copyright (C) 2025 Andreas VΓΆgele
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
and that's the whole page bestie, brought to you by perl v5.40.1, dated 2025-03-20 π
β¨ go forth and read your metadata, you've got this π«Ά
π¦ where this page comes from
- debian trixie: libip-geolocation-mmdb-perl 1.013-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libip-geolocation-mmdb-perl 1.013-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms