I don't lose any sleep over perl :)
Just noticed that you're trying to get data from a SSL connection though, which (my understanding) can't really be done. My recollection is that whilst you can establish a SSL connection and pass data to it, the data coming back is encrypted and can't really be read as such. you can receive the data and present it, but can't parse encrypted data for your sanitize requirement.
the hardest line to type correctly is: stty erase ^H