How do I edit CGI Scripts?

I've found a CGI script that seems to be dynamically building a web page based on a link that is selected. There is a banner (gif image) at the top that is the same for every generated page, but the bottom half of the page is different based on the link that was selected. I'd like to edit the script somehow to change the gif file used, its size, and some other features about how the page is being created. Is there a way to edit the script? I opened it in a simple text editor and it was full of ASCII characters. Are CGI scripts a compiled file that is usually written in Perl or another language? Is there a way to successfully edit this file? I'm fairly new to CGI so I'm not exactly sure how to approach this. Thanks.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CGI could be written in PERL (ASCII) or compiled executables if you programmed with languages such as C.  Anyhow, If you can see the text, and it starts with first line something like #!/usr/local/bin/perl, it is definitely a PERL script.  If you need to edit the file, simply look for the line that says about gif.  It may be xxx.GIF or xxx.gif.  It is case-sensitive.
With PERL, you do not compile.  What you see in the file is the way it will execute.

Another quick and dirty solution to do the job you need, I would just upload a file you want to show and change the new file name to the original name of the GIF file that was shown.

Your CGI will load your new image file anyway by the file name.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JagerMAuthor Commented:
It must be a compiled file because it's not intelligible when loaded into an ASCII editor. I've actually done what you said, i.e. switching the name of the gif file. It gets loaded, but the html that the cgi file is generating specifies the dimensions of the gif on the screen (width, height) and smushes it drastically. I guess there is no way to alter the compiled file? Is there a way to create another cgi file myself that has the same functionality? I can see the html source that is generated from the script if I go to View|Source in Internet Explorer. Could I somehow copy this into a new Perl script and replace the old one? Are there any pitfalls to this?
No pitballs at all.

If you see the gabled text, then it is binary executable which means, you cannot edit it.

What does the CGI script actually do?
Creating a CGI file isn't that hard.
Copy a simple one from the Internet and start modifying it.

The source you see in the HTML is the result generated from the CGI so it actually isn't really the content of the CGI script....
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.