I have a UNIX based perl project, with a main.pl
file which further uses some of the user defined perl modules. I want to add licensing to my perl project. What are the best ways to to it?

- 59,234
- 49
- 233
- 358

- 564
- 5
- 8
-
2Does this mean to you want to add a notice about the licensing (like: "this is free software") or do you want to have some scheme where users need to buy a license which then will be verified by the program? – Steffen Ullrich Nov 24 '15 at 07:41
-
There will be a licensing server, and my code will connect to that server to check for licenses. The problem is that if my perl code will be open the user would be able to just comment out the code that checks for license. One way for me would be to be able to hide the code from user. – Harley Nov 24 '15 at 07:46
1 Answers
Consider all of the millions of dollars that the entertainment and software industries have spent on DRM schemes to protect their digital wares, and how few of those products make it a week past release without being cracked. You're not going to do any better.
And that's without Perl making the cracks easier. Because the Perl binary needs access to the source code, it's effectively impossible to prevent the user from having access to that code. You can obfuscate it, you can use a packer to make it a standalone (pseudo-)binary file, etc., but all of these things are relatively trivial to work around.
The best approach, therefore, is to approach this as a legal problem rather than a technical one. Hire a good intellectual property lawyer and have them write up a licensing contract. Make your customers sign (not just click through - sign) this contract before receiving the software. If they violate the terms of the agreement, sic the lawyer on them.

- 45,363
- 14
- 64
- 102
-
I don't have much problem with user being able to retrieve my source code, I just don't want him to be able to comment out the code for checking license and then run it with his convenience. – Harley Nov 24 '15 at 08:17
-
1@Harley: like Dave said: make it a legal problem not a code problem. There is not really a way to protect code shipped to the client against any kind of modification by the client. You could make it harder by obfuscating the code but not impossible. – Steffen Ullrich Nov 24 '15 at 08:29
-
3Another way: don't distribute the program to the users, run the code on a server you pay for and make the users connect to it. – reinierpost Nov 24 '15 at 10:25
-
@Harley If the user can access the code, then the user can change the code. You can't prevent it technologically, so you need to address it in a different way, such as legally, or, as reinierpost suggested, by running the program on your own server so that the user never has direct access to the code. – Dave Sherohman Nov 25 '15 at 08:00