In the previous question, SearchigPerl says that his perl scripts just download instead of getting executed on the web server. This got me thinking...

if your scripts process online payments or perform some encryption or some secretive stuff, it would be a nightmare scenario if your server allowed people to see your perl source instead of executing it!

My question is how can a perl programmer avoid something like that? Is there a way to make sure that a page stays hidden in case it gets downloaded? For example, I tried to put a null character as the first byte in one of my scripts to make sure that the rest of the data will not download or stays hidden in case it doesn't get executed by the server. But it turns out I get a 500 Internal Server error when I try to execute my script. The server doesn't like when a perl script starts with a null character. Lol

Of course, I could try to obfuscate my perl script, but that's not a really foolproof idea. If someone really wanted to figure out what my script does, and they've got my source code in hand, it's just a matter of time before they figure out what it does.


In reply to hide perl script by harangzsolt33

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.