Solved

Hiding CGI-Perl Code...How?

Posted on 1998-03-19
2
273 Views
Last Modified: 2013-12-25
Sometimes I notice servers screw up on calls to CGI-Perl programs and instead of them launching the perl script, they actually show you the perl code like a text file being viewed in the broweser.

I'd hate for this to happen to my CGI-Perl code and would love to take any measures to prevent this.  What options do i have?

I've heard of using FILTER:: to hide your source code, but I really don't know much else than the name.  I've also heard of converting the perl source code into byte-code or C and compiling.  

Please, any help you can give me on hiding the contents of my perl code would be GREATLY APPRECIATED!

Thanks.
0
Comment
Question by:mirror
2 Comments
 
LVL 2

Accepted Solution

by:
haystor earned 90 total points
ID: 1832177
There are two possible causes of this:
one would be a runaway ", or '  during a print.  This should be easy enough to track down if you actually test your program after writing it.

The other cause would be not setting up the cgi-bin directory as a cgi directory.  If this is not done, and depending on the extension, and how the server handles it, it could be displayed as text/html.

Once you have your scripts running ok, you only need to worry about the first one.  Most runaway quotes will be caught at comile time by Perl.  However it is possible for the quotes to be just wrong enough to print your statement and continue printing your code beyond that.  There is no way around this, other than running your script, and viewing it yourself.

0
 
LVL 1

Expert Comment

by:thufir
ID: 1832178
The other possibility that occasionally happens is that the script isn't set executable.  ALWAYS be sure to run "chmod 755" on the script files.  I've had that happen on occasion...if it's not executable, the source will show in the browser.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now