in reply to Networking in perl
If you really want to mangle packets, you'll need something like Net::Pcap. Don't forget to change the source address too or you'll never get a reply.
My crystal ball tells me that you what you really want is NAT. Of course NAT isn't really about programming Perl so you might need to check out the documentation and/or forums for your OS.
In Section
Seekers of Perl Wisdom