Perl isn't slow (compared to say, C) because it's interpreted. It isn't interpreted in the way we normally think about interpreted. Perl code gets compiled before it can be run - Perl just doesn't have a separate compiling phase. But the speed gain from caching the compilation is small. Perl is slow because it's so flexible. It allows for things like:
push @array => splice @list, $foo, $bar, @new; $str .= "whatever";

And throw in memory management, dynamic scoping, AUTOLOADING, evalling and lots of other things that make it fun to program in Perl, and you will have a significant speed penalty to pay. Compiling will not solve that - you still will need to do the same steps Perl is already doing (and it's doing them in C code).

If for whatever reason you rather ship a binary instead of Perl code, you could always write a small C program, embed perl in the program, and pass your Perl program as a C string to the embedded perl interpreter. You might want to do some mungling of the code to defend against a strings attack.

Of course, the real defence against "source code" stealing is by using proper contracts. I used the work for a company that sold software, often for prices over $1,000,000. We threw in the source code (C) for free (many dozens of Mbs) for any customer requesting it. For some customers, being able to get the source code was a must - it needed to be auditted. We never run into any problems of code being "stolen". But we did get bugfixes this way.

Abigail


In reply to Re: Should we have PerlC and PRE? by Abigail-II
in thread Should we have PerlC and PRE? by dingus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.