The only real legal answer to that if you are concerned is talk to a lawyer (which I am not). As far as I understand these questions are still very much in the defining stage for the programming world, and the law varies quite considerably from country to country. There are far older forms of expression to which copyright law also applies which still suffer from the same definability problem. For example, the fact whether a certain piece of music is a derivative work from another can be governed by the length of a melody they share (in bars or seconds) as well as the length of the music in it's entirety. As far as I understand that is considered to be a pretty well nailed-down definition :-). I don't know if similar definitions will become commonplace for code (or what definitions are used in courts at the moment), but the problem seems to me to be much harder.
The bit about commercial organisations using CPAN modules in their entirety is relatively clear though. The modules license itself states under what terms and how you can and cannot use the module, abide by those rules and there should not be a problem (as long as no-one challenges the license in court in future and it is found to be invalid in itself). If a module does not come with a license, a paranoid company lawyer might want to contact the author and make sure that the license your company is presuming to use the module under (e.g. the Artistic License) is granted by the author.
My sarcasm filter seems to be slightly faulty atm, I can't really tell which part of your question was facetious and which wasn't. Once you "derive" from a piece of code you are copying from it and changing the variable names doesn't alter that fact more than playing "Johnny B.Goode" on a harp makes it your original work. If you look at an algorithm in a piece of code and then go away and reimplement it yourself you should be allright. I think. It depends. Ask a lawyer.
Oh, and if you were asking for my opinion on what's ethical as opposed to what's legal, it's quite simple, I try to respect an authors wishes to the best of my abilities.
Update: Trying to actually answer the questions:
- Define non-trivial: None of the examples you give are what I would consider non-trivial, they're all pretty commonplace elements of Perl programs and as such no author can go ahead and claim copyright for them. The is_numeric function is maybe the only one where this view is questionable, but again the idea isn't unique and it's "easy" to come up with on your own without having seen this example. A major part of determining whether a piece of creative work is copyrightable is the originality of the piece. Just as one cannot claim copyright for the musical note G you cannot claim copyright for 'if'. It's hard to define in terms of volume whether a piece of code is in itself copyrightable, particularly since algorithms as such cannot be copyrighted (they may be patentable, depending on your country's legislation, but that's a different story entirely). The only real guide one has is to ask, am I copying this code or am I taking the idea behind the code and using it for my own program. The former would be copyright infringement, the latter not.
- No, copy-paste has nothing to do with it and that was a bad choice of words on my part. The important part here is that you are copying a piece of work, the mechanism of the copy is irrelevant. It may be relevant in court, because it's easier to prove copyright infringement if the copied code retains the original comments and tab spacings, but that's just an artefact of truth-finding, not that copy-pasting itself is more or less illegal than other kinds of copying.
- Schwartzian Transform: I don't know whether merlyn claims copyright for that or whether he could if he wanted to, I'm not knowledgeable enough to determine that. I'm pretty sure you do not need his permission to use the Transform (it's available under the Perl Artistic License at least), I don't know whether you should attribute it to him. And again, the algorithm of the transform is not copyrightable, a specific representation of the algorithm may be.
And again, I am not a lawyer, any opinion I give here is my interpretation of laws and based solely on others (often non-lawyers themselves) interpretation of the law.
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian W. Kernighan
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.