perllove has asked for the wisdom of the Perl Monks concerning the following question:

I was just thinking during my travel in bus the difference between Java and Perl in terms of distribution of code. When a company sells Java code/software, they typically distribute binaries packed in jars. And their code cannot be viewed unless it is an open source code. I mean they can hide their code in machine code.

My question is how is Perl distributed? If some one writes Perl code for money how should he deploy it, should he give all the code to the customer? I mean the scripts and modules? But what stops them from reselling it or extending it themselves? I wonder if this has something to do with the license of the software which states that any one can freely distribute it and extend it.

Is this the so called obfuscation used for? I know that its not a respectable or decent option but just a random meditation.

20070621 Janitored by Corion: Added formatting, code tags, as per Writeup Formatting Tips

Replies are listed 'Best First'.
Re: How is Perl code distrubuted?
by Moron (Curate) on Jun 21, 2007 at 14:19 UTC
    As the name suggests, it's what par is for (see also PAR::FAQ). Note also the comment about 100% obfuscation being impossible, or to put it in terms of a conjecture of my own: "to every security measure there exists a loophole and to every loophole there exists a security measure" ;)

    Update: to illuminate the term "obfuscation", we talk about obfuscating source code as a geeky hobby - it's a sort of in-group elitism thing and relates to "play" code. The question of obfuscating for distribution is entirely different and uses binary obfuscation - the original source code for serious work should definitely NOT be obfuscated but should of course be maintainable!!

    More update: The official (as well as therefore monk-popular) answer to How can we do business with Perl is to license it. But if you trace the discussion first there and then take the link back to 2006 you'll find plenty of points about how really to build a Perl business. My personal idea I plan to use is have a licensing server say http that the product checks in with say on startup to see if its IP address is registered and otherwise fatal error or alternative fatal error for unplugged case: "Fatal error requesting license key from manufacturer site" ;) yes okay it could be hacked but I am really out to stop people copying software internally in a company for free as a genuine mistake without realising that it isn't in the deal to have multiple implementations without permission - horses for courses.

    __________________________________________________________________________________

    ^M Free your mind!

Re: How is Perl code distrubuted?
by derby (Abbot) on Jun 21, 2007 at 14:48 UTC

    they typically distribute binaries packed in jars. And their code cannot be viewed unless it is an open source code.

    That's not true at all. A jar is just a collection of java class files and java class files can be de-compiled into source code. Maybe it's not as easy to read as the original but it's not that difficult either. Just like perl, the only thing controlling what you do with the it is the license it's released under.

    -derby

    update: BTW, I had to go the decompiler route for one of my own jars when I lost the code - bad dev ... no cookie.

Re: How is Perl code distrubuted?
by ides (Deacon) on Jun 21, 2007 at 14:50 UTC
    But what stops them from reslling it or extending it themselves?

    The answer is: The only thing that *really* stops anyone. The license/contract the developer gave to the customer. If the customer violates the license, you sue them. It's apparently the American way. :)

    Just because something is binary, packed in a jar, etc. does not mean it is impossible to "resell" or "extend". It just makes the extenstion part more difficult, not impossible.

    Frank Wiles <frank@revsys.com>
    www.revsys.com

Re: How is Perl code distrubuted?
by swampyankee (Parson) on Jun 21, 2007 at 16:28 UTC

    But what stops them from reselling it or extending it themselves?

    Honesty. What stops you from running of copies of Gwen Stefani's latest CD, except honesty and good taste?

    Is this [what] the so called obfuscation used for?

    Sometimes, but obfuscation seems to be more a form of amusement.

    I wonder if this has something to do with the license of the software which states that any one can freely distribute it and extend it.

    No. The license does not apply to programs written in Perl; it applies to Perl and its core modules. Similarly, programs written in gcc or g++ are not subject to the GPL, but gcc and g++ are.

    Even compiled binaries can be de-compiled. It's what disassemblers are for.

    emc

    Any New York City or Connecticut area jobs? I'm currently unemployed.

    There are some enterprises in which a careful disorderliness is the true method.

    —Herman Melville
Re: How is Perl code distrubuted?
by marto (Cardinal) on Jun 21, 2007 at 14:16 UTC