#!/usr/bin/perl use strict; use warnings; use IO::Interface; use IO::Socket; # Create a simple socket to use with interfaces my $s = IO::Socket::INET->new(Proto => 'udp'); # Get list of interfaces my @interfaces = $s->if_list; my $addr; # Iterate over list of interfaces foreach (@interfaces) { $addr = $s->if_addr($_); print "interface = $_ : address = $addr\n"; }
In reply to Re: Getting my IP adresses
by cengineer
in thread Getting my IP adresses
by ruoso
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |