Solved

Hiding CGI-Perl Code...How?

Posted on 1998-03-19
2
282 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
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…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

828 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