PracticeDev/study_perl/get.pl

6 lines
177 B
Perl
Raw Normal View History

2022-12-20 17:31:11 +08:00
use Net::Address::IP::Local;
# Get the local system's IP address that is "en route" to "the internet":
my $address = Net::Address::IP::Local->public;
print("$address\n");