Hi,
For an understanding, maybe this link
https://metacpan.org/pod/MCryptwill help on the different constants u are using. But i think u need a basic understanding of cipher based encryption first and foremost. From my experience, Rijndael is the place to end your study,not start it, as it is one of the most current and IMHO complex ciphers around.. :D
All the best!
CBC (cipher block chaining) is especially suitable for encrypting files where the security is increased over ECB significantly.
The temporal difficulty with perl is u need to know C well to know the awesome.else u just keep *using* it and writing inefficient code