Welp, I had just installed libnet 1.0901, perl 5.002 (yes, I know it's out of date... no upgrade on it currently possible). This is on a MacOS X machine, fwiw.
I also forgot to mention that I had cut out the error checking I had been doing, for the sake of posting a smaller amount of code. I am doing error checking. Thanks for mentioning it tho.