#!/usr/bin/perl use strict; use warnings; use IO::Socket::INET; my $port = getservbyname 'bootps', 'udp'; my $socket = IO::Socket::INET -> new (LocalPort => $port, Broadcast => 1, Proto => 'udp') or die "Failed to bind to socket: $@"; my $mess; while ($socket -> recv ($mess, 1024)) { print "Saw a bootp request.\n"; } __END__ #### udp 0 0 *:bootps *:*