Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Getting my IP adresses

by cengineer (Pilgrim)
on May 15, 2007 at 14:39 UTC ( #615558=note: print w/replies, xml ) Need Help??


in reply to Getting my IP adresses

Here's another way to get the IP addresses of your interfaces using IO::Interface and IO::Socket:
#!/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"; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://615558]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2023-12-07 13:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (32 votes). Check out past polls.

    Notices?