Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: Perl modules and the GPL

by Corion (Pope)
on Feb 01, 2010 at 21:06 UTC ( #820843=note: print w/replies, xml ) Need Help??

in reply to Perl modules and the GPL

As far as I understand it, the GPL only governs distribution. As the GPL is implemented via copyright and the concept of a "derived work", and use of an API is not a "derived work", the interpreter gap that Perl creates insulates your code while using a GPLed library. Any XS wrapper (statically) linking to a GPLed library gets infected by the GPL, but that's where the infection ends. If you want to play it really safe, you can write a second implementation to the same API, like Term::ReadLine::Perl is for Term::ReadLine.

Replies are listed 'Best First'.
Re^2: Perl modules and the GPL
by zwon (Abbot) on Feb 01, 2010 at 21:56 UTC
    Any XS wrapper (statically) linking to a GPLed library

    As far as I understand dynamic linking of GPL libraries with proprietary programs are not allowed either. There was a famous email conversation between RMS and Bruno Haible where they discussed this question.

      There is no fact, mere "discussions with a lawyer" regarding dynamic linking, and I don't see the linking that Perl does (dynamically loading object code) as "creating a derivative work" in the same sense that linking to a C header creates a "derivative work", because to use the API from Perl does not involve the C headers.

      Building the XS component involves the C headers and thus makes the XS component a derivative work, but that cannot infect the Perl program, no matter how much RMS wants this to.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://820843]
[perldigious]: but... but... perldigious is the unvirtuous kind of lazy in this case. :-)
[perldigious]: Just kidding. Thanks 1nickt, I'll go ahead and do it the right way. An extra set of brackets and a little extra indentation isn't too much to ask.
[karlgoethebier]: perldigious: perhaps a block if you are paranoid ;-)
[choroba]: but undef %hash and %hash = () both work, too, but the first one keeps the memory allocated, while the latter makes it available for other parts of the program.
[choroba]: iirc
[perldigious]: karlgoethebier: Well it is a pretty old and complicated (for me) bit of code I wrote (poorly by my current standards), so I'm expecting everything to break when I add the scoping and find out what else is undesireably scope changed. :-)
[perldigious]: Ah, thanks choroba, that sort of thing was precisely what I was wondering when I asked.

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2017-07-21 19:51 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (335 votes). Check out past polls.