NAME

Net::MyIP - Get your public facing IPv4 or IPv6 address

Coverage Status

SYNOPSIS

use Net::MyIP;

my $ipv4_addr = myip();
my $ipv6_addr = myip6();

DESCRIPTION

For end-users, please review the documentation for the distmgr program that we've installed for you as part of this distribution.

This software uses the api[64].ipify.org website to fetch your public IP address. We do this in as small and tight a package as we can.

FUNCTIONS

There are only two functions we provide, both exported into your namespace by default.

myip

Returns a string containing your IPv4 address. If one isn't found, we'll return an empty string.

myip6

Returns a string containing your IPv6 address if available. If one isn't found, we'll return an empty string.

AUTHOR

Steve Bertrand, <steveb at cpan.org>

LICENSE AND COPYRIGHT

Copyright 2022 Steve Bertrand.

This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:

http://www.perlfoundation.org/artistic_license_2_0