Try looking at the source for Net::TFTP. That should provide
a good start for the transfer protocol iself. I agree that
reverse DNS lookups and some sort of authentication is
required. Take a look at the PAM modules on CPAN for a good
portable way to implement this. You can also use the
Net::SSL module for connection privacy.