I haven't ever written anything with HTTP::Proxy but it looks very flexible so you might be able to convince it to work with SSL. On the other hand, HTTP::Proxy isn't really designed for MITM attacks so it'll want to add the proper headers and such.

One way to do this would be to use POE. You can do something based on the Cookbook example of a simple Web Proxy.