1Net::IP::Minimal(3) User Contributed Perl Documentation Net::IP::Minimal(3)
2
3
4
6 Net::IP::Minimal - Minimal functions from Net::IP
7
9 version 0.06
10
12 use Net::IP::Minimal qw[:PROC];
13
14 my $ip = '172.16.0.216';
15
16 ip_is_ipv4( $ip ) and print "$ip is IPv4";
17
18 $ip = 'dead:beef:89ab:cdef:0123:4567:89ab:cdef';
19
20 ip_is_ipv6( $ip ) and print "$ip is IPv6";
21
22 print ip_get_version( $ip );
23
25 Net::IP is very feature complete, but I found I was only using three of
26 its functions and it uses quite a bit of memory
27 <https://rt.cpan.org/Public/Bug/Display.html?id=24525>.
28
29 This module only provides the minimal number of functions that I use in
30 my modules.
31
33 The same as Net::IP these functions are not exported by default. You
34 may import them explicitly or use ":PROC" to import them all.
35
36 "ip_get_version"
37 Try to guess the IP version of an IP address.
38
39 Params : IP address
40 Returns : 4, 6, undef(unable to determine)
41
42 "$version = ip_get_version ($ip)"
43
44 "ip_is_ipv4"
45 Check if an IP address is of type 4.
46
47 Params : IP address
48 Returns : 1 (yes) or 0 (no)
49
50 "ip_is_ipv4($ip) and print "$ip is IPv4";"
51
52 "ip_is_ipv6"
53 Check if an IP address is of type 6.
54
55 Params : IP address
56 Returns : 1 (yes) or 0 (no)
57
58 "ip_is_ipv6($ip) and print "$ip is IPv6";"
59
61 Net::IP
62
64 Chris Williams <chris@bingosnet.co.uk>
65
67 This software is copyright (c) 2012 by Chris Williams and RIPE-NCC.
68
69 This is free software; you can redistribute it and/or modify it under
70 the same terms as the Perl 5 programming language system itself.
71
72
73
74perl v5.36.0 2022-07-22 Net::IP::Minimal(3)