You might want to download the documentation from the Payal web site, merchant services so you understand how their system and API works. Look for *Website Payments Standard Integration Guide* in the left column. There are also some Perl code examples buried somewhere in the site.
The advantage of using Paypal (or similar services) is that you do not need to have your own merchant account and processing gateway and the associated monthly fees. You also do not need to have ssl. However, the payment transaction is done on the Paypal site. You can customize your account so it's fairly seamless, but it will not be completely transparent to your customers.
If you do use Paypal, I recommend that you also sign up for a developers account so you can test using their sandbox without processing real transactions. I've handrolled a few basic payment apps using LWP and their API. Basically it just exchanges text data via name-value pairs over http/https posts. Hope this helps.