First, you need to purchase a SSL certificate from a reputable company like
Thawte or
Go Daddy. Then install that certificate on your server. You should be able to find instructions in the documentation for your server on how to install the certificate and require it to be used when someone visits your website. And that's it. You shouldn't have to make any changes to your Perl scripts.