Net::RawIP is a perl module that can manipulate raw IP packets with an optional feature for manipulating Ethernet headers.