Perl is the most common scripting language for CGI scripts due to the fact that most hosting services provide it as part of their hosting plans and it's relatively easy to use. Additionally, the majority of ISP's use some form of Unix/Linux platform and the Perl language was developed primarily for those OS systems.
Yes, you can write your scripts in C but remember that not all ISP's will allow .exe programs to be loaded on their systems. Or you could use Visual Basic provided you can load the necessary support files to your cgi-bin directory.
If you look around this forum you'll find more than a few requests about CGI scripts for C and VB. Don't be shy - ask away! There's always a better way...
I'm not the least bit shy.
I write my cgi scripts in tcl, awk, ksh, bash or C.
I've never had the need to write anything in perl.
BAIT: Should I?
I simply object to the fact that perl is linked
with cgi in some way in this forum.
I feel that is attributing to perl something that
it isn't is, is it.
Who wants to have to say "blah strict" to keep
from being rooted after all?
If you think that perl-specific questions are inappropriate in this forum, redflag them as off-topic. Or politely point out to the poster that his question would be better asked in the perl form and THEN redflag is post as off-topic.
You don't like perl? Don't use it. I don't like cauliflower, so I don't eat it. But I don't sit in a restaurant and kvetch at everyone who is eating it.
I do know that I've seen a lot more CGI apps written in perl scripts than in bash scripts. From that and your comments in this thread I can only infer that either half a million people are completely deluded, or you've missed out on something. No offense, but I'm going to vote with the majority on this one. ______________________________________________________________________
TANSTAAFL!
I agree that there is a body of knowledge/expertise that is CGI and is independent of Perl. However, due to Perl's rich syntax, OS independence, and powerful regex engine it is a very good tool/language for doing CGI. Also, due to Perl's rich syntax, it is wonderful in a rapid application development situation. And, if you happen to be running Apache as your web server, the mod_perl Apache module makes Perl as fast as compiled C. Perl's effectiveness as a CGI language is evidenced by the number of people/organizations that use it for CGI.
On the topic of how many people use Perl for CGI......
I disagree with the assertion that most people use Perl for CGI becasuse that is what their ISPs provide. That is true for a section of the population. However, those ISPs would not be providing it as on option if it where not a competent tool in the first place. I have never written code to run on a remote ISP's machine. Rather, I have always worked for organizations that needed to do web stuff and looked for the best tools. For the three jobs/organizations in the last 12 years, based on a objective view of the options, Apache/Perl has been the answer. Powerful, free, flexible, and rock solid dependable. Again, Perl dominates the CGI landscape becuase it is a very good tool for the job.
That having been said/typed,..... if you have CGI questions and you write C/C++, then the answers given in Perl usually be very relevant, if the question is truely a CGI question and not a C syntax question.
Finally, I invite you to add the additional flavor to the CGI mix here at TTs. I usually answer in Perl-ese, you could present the a perspective from the world of 'C'. 'hope this helps
If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.
Cgi Scripting with the shell/awk/sed is very simple,
but is deprecated because most people don't code safely
all the time.
It's simple and painless for the most part.
You have merely said that you don't like perl and that you use c or tcl.
At no point have you given reasons why tcl or c is better than perl as a CGI language.
______________________________________________________________________
TANSTAAFL!
"At no point have you given reasons why tcl or c is better than perl as a CGI language...."
No, and that was never my intent. Perl is not necessary,
you can do it another way. Where does this mean that it's no good?
And we are back to the start....
Why is the cgi forum all about Perl?
I wouldn't dare post a question here for fear that I
would get some perl scribbling that only make sense to
the perly folk...
This forum is not all about perl. I have seen questions here pertaining to PHP, ASP, and a couple of times interesting discussions about implementing CGI in home-brewed web servers. ______________________________________________________________________
TANSTAAFL!
I for one luv to have another language at my disposal. Using C++ to extend PERL or alone are good options. ASP is a fine language using VBscript or PERLscript and is rapidly growing in its usuage due to its speed. The best language is the one in which you can get the job done quickest. RAD is the key to success and PERL for CGI seems to have great results.
I think the main key that PERL and PHP are so popular for CGI are they are easy to learn, Free, nearly universal server support and have a large following of ppl willing to help the new person. Which is not always the case with C/C++.
Applications developed in C/C++ or ASP may find themselves limited to win32 based servers becuase ASP in only FREE on IIS and a 400$ charge to add it to apache servers. Tcl, awk, ksh, bash again may not be universally supported across servers.
You have to admit the server service can make a company decide to change host and have a very cross platform application limits cost in the event of a move.
Everything is driven by the market. PERL is universally recognized and supported which for one reason or another some of the other languages may not be supported. Due to high demand there are a lot of programmers out there for PERL.
Admittedly, there is always a better way that is the foundation of PERL. PERL will never always be the answer but as for CGI there are the big 4: Coldfusion, ASP, PERL and PHP.
Programmers have chosen these tools to get the job done. It seems that the other languages have some snag that makes them a less attractive.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.