Net::IP::Minimal(3pm)

πŸ“¦
version 0.06 Β· 5 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’– Net::IP::Minimal(3pm) πŸ’–

okay bestie, welcome to Net::IP::Minimal β€” and yes, it's from the User Contributed Perl Documentation section, we love a community moment ✨


🌸 NAME 🌸

Net::IP::Minimal β€” the minimal-est little functions from Net::IP, no cap πŸ’…


⭐ VERSION ⭐

version 0.06 β€” she's tiny, she's iconic πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

okay so this is literally the whole vibe:

use Net::IP::Minimal qw[:PROC];

my $ip = '172.16.0.216';

ip_is_ipv4( $ip ) and print "$ip is IPv4";

$ip = 'dead:beef:89ab:cdef:0123:4567:89ab:cdef';

ip_is_ipv6( $ip ) and print "$ip is IPv6";

print ip_get_version( $ip );

look at her go 😭 so simple. so powerful. main character energy fr fr πŸ‘‘


✨ DESCRIPTION ✨

so Net::IP is very feature complete, like she has EVERYTHING, she's the popular girl πŸ’– β€” but the author found they were literally only using three of her functions, and she uses quite a bit of memory (<https://rt.cpan.org/Public/Bug/Display.html?id=24525>). not the memory usage being the villain of the story πŸ’€

so this module? it only provides the minimal number of functions that the author uses in their modules. lowkey minimalism. highkey efficient. we stan a lean queen 🧚


πŸŽ€ FUNCTIONS πŸŽ€

just like Net::IP, these functions are not exported by default β€” she's playing hard to get πŸ™ˆ you can either import them explicitly, or use :PROC to import them all at once. dealer's choice bestie ✨

πŸ’œ ip_get_version

try to guess the IP version of an IP address πŸ”

Params  : IP address
Returns : 4, 6, undef(unable to determine)

usage vibes:

$version = ip_get_version ($ip)

πŸ’œ ip_is_ipv4

check if an IP address is of type 4 🌈

Params  : IP address
Returns : 1 (yes) or 0 (no)

usage vibes:

ip_is_ipv4($ip) and print "$ip is IPv4";

πŸ’œ ip_is_ipv6

check if an IP address is of type 6 πŸ¦‹

Params            : IP address
Returns           : 1 (yes) or 0 (no)

usage vibes:

ip_is_ipv6($ip) and print "$ip is IPv6";

πŸ‘€ SEE ALSO πŸ‘€

  • Net::IP β€” the big sister module, go say hi 🫢

🌟 AUTHOR 🌟

Chris Williams <chris@bingosnet.co.uk> β€” icon behavior, we thank you for your service πŸŽ€


This software is copyright (c) 2012 by Chris Williams and RIPE-NCC.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay, open source rights πŸ’–


okay that's the whole page bestie, hope it was giving everything you needed πŸ’… this lil cutie is documented as of perl v5.32.0, dated 2021-01-05, filed under Net::IP::Minimal(3pm) β€” mwah, bye! πŸŒΈπŸ¦‹βœ¨

πŸ“¦ where this page comes from