Net::MyIP - Get your public facing IPv4 or IPv6 address
use Net::MyIP; my $ipv4_addr = myip(); my $ipv6_addr = myip6();
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.
There are only two functions we provide, both exported into your namespace by default.
Returns a string containing your IPv4 address. If one isn't found, we'll return an empty string.
Returns a string containing your IPv6 address if available. If one isn't found, we'll return an empty string.
Steve Bertrand, <steveb at cpan.org>
<steveb at cpan.org>
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
To install Net::MyIP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::MyIP
CPAN shell
perl -MCPAN -e shell install Net::MyIP
For more information on module installation, please visit the detailed CPAN module installation guide.