develooper Front page | perl.beginners | Postings from December 2022

Re: providing perl api for C library

Thread Previous | Thread Next
From:
sisyphus
Date:
December 10, 2022 13:09
Subject:
Re: providing perl api for C library
Message ID:
CADZSBj3NN4Ebd2-PdYTckvXMk5cqDnJ6mrznGOX21EZFQwOF0A@mail.gmail.com
On Sat, Dec 10, 2022 at 2:19 PM Henry R <support@openmbox.net> 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

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About