473,320 Members | 1,936 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Perl or C++ for CGI?

Hi!

First of all, I'm amazed by the potential of CGI. But I'm fairly new to Perl and I'm wondering if it were better for me to code my dynamic web content in C++ instead of Perl. With 'dynamic web content' I mean a community site that should have the potential to grow. Yes, I know that I'd have to compile the code every time I change a tiny bit, but the reason why I'm thinking about prefering C++ is that I'm pretty familiar with it (compared to Perl), since I used it for years now.

So, here's my question: is there any good reason why I should prefer Perl? Take www.thescripts.com for example, or any other large website. Would it be a bad idea to code such a project in C/C++ or any other compiler language and then use CGI to communicate with Apache?

Don't get me wrong, I have nothing against Perl. It's just that I know C++ much better. I know how to do what I want. And I know what I get.

So any help is welcome, especially from those who know both C++ and Perl. :)
Dec 25 '07 #1
6 1411
Kelicula
176 Expert 100+
Hi!

First of all, I'm amazed by the potential of CGI. But I'm fairly new to Perl and I'm wondering if it were better for me to code my dynamic web content in C++ instead of Perl. With 'dynamic web content' I mean a community site that should have the potential to grow. Yes, I know that I'd have to compile the code every time I change a tiny bit, but the reason why I'm thinking about prefering C++ is that I'm pretty familiar with it (compared to Perl), since I used it for years now.

So, here's my question: is there any good reason why I should prefer Perl? Take www.thescripts.com for example, or any other large website. Would it be a bad idea to code such a project in C/C++ or any other compiler language and then use CGI to communicate with Apache?

Don't get me wrong, I have nothing against Perl. It's just that I know C++ much better. I know how to do what I want. And I know what I get.

So any help is welcome, especially from those who know both C++ and Perl. :)
From what I understand it is perfectly acceptable to write CGI scripts in C++, however there are a lot of perl "modules" that are specifically designed with web scripting in mind. Which means less programming for you.
Also perl is written in C, so what it basically is is an abstracted scripting language designed with data manipulation in mind; meaning you can accomplish more with less. The small amount of time spent learning the basics of perl would proably pay off in the end with tidier easier to maintain less time consuming code.

Good luck!
Dec 25 '07 #2
Thank you for your reply and your fresh look on this problem! I completely agree with you and now think that it's better to use Perl.

The small amount of time spent learning the basics of perl would proably pay off in the end with tidier easier to maintain less time consuming code.
Which probably means much less bugs and security holes, since those are easier to spot in a tidy, clean script, than in a complex C++ source code.

Good luck!
Thank you :)

But I got one question left: Is Perl "better" than PHP? Is it more secure? Is it more efficient, etc?

Thank you again for your patience.
Dec 26 '07 #3
Kelicula
176 Expert 100+
But I got one question left: Is Perl "better" than PHP? Is it more secure? Is it more efficient, etc?

Thank you again for your patience.
Yes! Perl IS better than php.
PHP is eaiser to learn..maybe...but as of late the interpreter was troublesome, and in general it is newer and not as quick as perl.

Perl has been around for as long as the internet (well, almost) and it is tried and true so to speak.

Perl has built in functions for say, encryption, and formatting headers etc...
Also there are TONS of modules written for perl, that can handle just about anything you will need to do concerning CGI environment.

The only real drawback compared to php is in creating pages with embedded code. BUT there are also lots of modules out now to help with that. I recommend Template::Toolkit a very powerful template module that will allow you to do pretty much anything when it comes to creating dynamic web pages..or dynamic documents of any kind actually.

I recommend getting acquainted with these:

CGI module
Template Toolkit
DBI

And just CPAN in general:
CPAN

You can even create graphics on the fly, from a data source with perl:
GD module

Happy coding!
Dec 27 '07 #4
Thank you for your helpful post! I'll soon try out the links you gave me!

Take care. :)
Dec 27 '07 #5
When I was in school one of the first PERL programs we wrote was a CGI script for a website.

I have done it before in PERL, but I am not sure about C++.


I am using Perl for Oracle backups also
Dec 29 '07 #6
KevinADC
4,059 Expert 2GB
When I was in school one of the first PERL programs we wrote was a CGI script for a website.

I have done it before in PERL, but I am not sure about C++.


I am using Perl for Oracle backups also
Perl has been used for a long time to write CGI scripts.
Dec 29 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Mark Wilson CPU | last post by:
This must be easy, but I'm missing something... I want to execute a Perl script, and capture ALL its output into a PHP variable. Here are my 2 files: -------------------------------------...
31
by: surfunbear | last post by:
I've read some posts on Perl versus Python and studied a bit of my Python book. I'm a software engineer, familiar with C++ objected oriented development, but have been using Perl because it is...
0
by: Kirt Loki Dankmyer | last post by:
So, I download the latest "stable" tar for perl (5.8.7) and try to compile it on the Solaris 8 (SPARC) box that I administrate. I try all sorts of different switches, but I can't get it to compile....
13
by: Otto J. Makela | last post by:
I'm trying to install to php the Perl-1.0.0.tgz package (from http://pecl.php.net/package/perl, enabling one to call perl libraries) to a pre-existing Solaris system. Unfortunately, the attempt...
6
by: surfivor | last post by:
I may be involved in a data migration project involving databases and creating XML feeds. Our site is PHP based, so I imagine the team might suggest PHP, but I had a look at the PHP documentation...
4
by: billb | last post by:
I installed a perl extension for PHP to use some perl inside my php primarily because I have perl working with oracle and not php and oracle. So I want to use my old perl scripts, and use the...
21
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.