Yes, you can, since Perl has access to sockets. An example of the rup program written in Perl can be found in the script ruptime.pl at the scripts archive on ftp.cis.ufl.edu. I warn you, however, that it's not a pretty sight, as it's used nothing from h2ph or c2ph, so everything is utterly hard-wired.
Other resources at this site: