No, user space Perl programs cannot do that. Your only option
is to accept or not accept a connection - and you cannot get
the information of an incoming connection (like its IP address) without first accepting it.
What you want to do is normally done at kernel level (although
in some implementations, the kernel can consult a user space
program to make the decision).