Solved

Hiding CGI-Perl Code...How?

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
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.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

759 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

20 Experts available now in Live!

Get 1:1 Help Now