Re: providing perl api for C library
sisyphus <[email protected]> Sun, 11 Dec 2022 00:09:19 +1100
| Newsgroups | gmane.comp.lang.perl.beginners |
|---|---|
| Message-ID | <CADZSBj3NN4Ebd2-PdYTckvXMk5cqDnJ6mrznGOX21EZFQwOF0A@mail.gmail.com> |
On Sat, Dec 10, 2022 at 2:19 PM Henry R <[email protected]> wrote: > Hello list, > > I have written a C library which encrypts the data stored in object > storage like S3. > If I want to provide it with a perl OO interface what's the right way? > such methods like: > > $data->encrypt("input.sth"); > $data->decrypt("input.sth"); > I generally use Inline::C to access C libraries. (Take a look at the Cookbook that ships with the Inline::C source distro and see what you think.) For something similar, but with a steeper learning curve and a few extra complications, there's also XS (perldoc perlxs) - but I think Inline::C is a good starting point from which you can migrate to XS if you so desire. Cheers, Rob