IO::In...:Simple(3pm)
πΈ NAME πΈ
IO::Interface::Simple β bestie, it's the Perl extension for access to network card configuration information. π
(The header of this here manual page calls it IO::In...:Simple(3pm), and it hangs out in the User Contributed Perl Documentation section, iykyk.)
β¨ SYNOPSIS β¨
use IO::Interface::Simple;
my $if1 = IO::Interface::Simple->new('eth0');
my $if2 = IO::Interface::Simple->new_from_address('127.0.0.1');
my $if3 = IO::Interface::Simple->new_from_index(1);
my @interfaces = IO::Interface::Simple->interfaces;
for my $if (@interfaces) {
print "interface = $if\n";
print "addr = ",$if->address,"\n",
"broadcast = ",$if->broadcast,"\n",
"netmask = ",$if->netmask,"\n",
"dstaddr = ",$if->dstaddr,"\n",
"hwaddr = ",$if->hwaddr,"\n",
"mtu = ",$if->mtu,"\n",
"metric = ",$if->metric,"\n",
"index = ",$if->index,"\n";
print "is running\n" if $if->is_running;
print "is broadcast\n" if $if->is_broadcast;
print "is p-to-p\n" if $if->is_pt2pt;
print "is loopback\n" if $if->is_loopback;
print "is promiscuous\n" if $if->is_promiscuous;
print "is multicast\n" if $if->is_multicast;
print "is notrailers\n" if $if->is_notrailers;
print "is noarp\n" if $if->is_noarp;
}
π¦ DESCRIPTION π¦
So IO::Interface::Simple lets you interrogate and change network interfaces. Periodt. It's got overlapping functionality with Net::Interface, but β plot twist β it might compile and run on more platforms. More platforms = more slay. π«Ά
π Class Methods π
$interface = IO::Interface::Simple->new('eth0')β hand it an interface name andnew()hands you back an interface object. That's it, that's the whole vibe.@iflist = IO::Interface::Simple->interfaces;β returns a list of active interface objects. All the live ones, lined up. π₯$interface = IO::Interface::Simple->new_from_address('192.168.0.1')β gives you back the interface object that corresponds to the address you passed in. Match made in heaven fr fr.$interface = IO::Interface::Simple->new_from_index(2)β gives you back the interface object corresponding to the given numeric index. β οΈ Heads up bestie: this one is only supported on BSD-ish platforms.
π Object Methods π
$name = $interface->nameβ gets the name of the interface. Oh and the interface object is overloaded</>, so if you use it in a string context it does the exact same thing as callingname(). Lowkey iconic.$index = $interface->indexβ gets the index of the interface. Again: only supported on BSD-like platforms. Sorry to the Linux girlies. π$addr = $interface->address([$newaddr])β get or set the interface's address.$addr = $interface->broadcast([$newaddr])β get or set the interface's broadcast address.$addr = $interface->netmask([$newmask])β get or set the interface's netmask.$addr = $interface->hwaddr([$newaddr])β get or set the interface's hardware address.$addr = $interface->mtu([$newmtu])β get or set the interface's MTU.$addr = $interface->metric([$newmetric])β get or set the interface's metric.$flags = $interface->flags([$newflags])β get or set the interface's flags. You can AND these with theIFFconstants exported byIO::InterfaceorNet::Interfaceto interrogate the state and capabilities of the interface. That said, it's probably way comfier to just use the broken-out methods listed right below. π$flag = $interface->is_running([$newflag])$flag = $interface->is_broadcast([$newflag])$flag = $interface->is_pt2pt([$newflag])$flag = $interface->is_loopback([$newflag])$flag = $interface->is_promiscuous([$newflag])$flag = $interface->is_multicast([$newflag])$flag = $interface->is_notrailers([$newflag])$flag = $interface->is_noarp([$newflag])
These get or set the corresponding configuration parameters. π«Ά
β οΈ Real talk: the operating system may not let you set some of these. Not a bug, just the OS being the OS. π
π AUTHOR π
Lincoln D. Stein <lincoln.stein@gmail.com> β Copyright 2001-2014, Lincoln D. Stein.
This library is distributed under the Perl Artistic License 2.0. Please see LICENSE for more information.
π SUPPORT π
For feature requests, bug reports and code contributions, please use the GitHub repository at https://github.com/lstein/LibIO-Interface-Perl
β SEE ALSO β
perl, IO::Socket, IO::Multicast), IO::Interface, Net::Interface
Ok that's the whole page bestie, you ate it up. π Signing off with the receipts: this was perl v5.42.3, dated 2026-08-19, and the page is IO::In...:Simple(3pm). Go talk to some network cards, main character. π§π
π¦ where this page comes from
- ubuntu stonking: libio-interface-perl 1.09-2build7 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms