Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl vs PHP

Status
Not open for further replies.

Eloff

Programmer
Aug 29, 2001
78
CA
It strikes me that PHP is easier to use at taking input from forms and interfacing with mysql. The fact that it fits right into your html page makes it even better. Whats the downside to php? why is perl the industry standard? Age: 17
School: Alberta Distance Learning Center
Location: British Columbia, Canada
If at first you dont't succeed, try, try again. - programmer's motto.
 
Hi,

Perl has been around a lot longer than PHP. It also has broader functionality than PHP in that it can be used for about anything, while PHP was specifically built to work with databases, especially MySQL, in an Internet HTML setting. Perl, although very capable in the Internet environment really has its roots in the administration of UNIX networks. Peal has long been the favorite tool of the system administrator. It has also been referred to as the glue that holds the Internet together. It is an ideal tool for editing, formatting, and reporting on text data. Perl is generally more robust than PHP, although both are fine products in their area of expertise. Also, perl has been added as one of the tools to be included in Microsoft’s .NET development suite, so it is starting to make inroad into the window arena. You can also use a new perl module to provide or consume web services which could be the next hot growth area of the internet. PHP will continue to grow but it doesn’t yet provide all the feature of Perl. However, it’s an improvement over HTML which is mostly for displaying text and graphics. You can’t add 1+1=2 with HTML. Therefore you need some kind of CGI or other business logic to provide the missing functionality and to make HTML dynamic. Perl also has the DBI modules to work with about any database. There are tons of people creating new programs and modules with perl and they are happy to share in the spirit of the open Linux and UNIX community.

The opinion expressed here are strictly mine.

Leland
Leland F. Jackson, CPA
Software - Master (TM)
Nothing Runs Like the Fox
 
Well I'm glad to know that its not because PHP has serious problems associated with it. For my current application it is well suited to the task. And besides which I never did figure out how to install that wretched DBI module. Age: 17
School: Alberta Distance Learning Center
Location: British Columbia, Canada
If at first you dont't succeed, try, try again. - programmer's motto.
 
Hi Eloff,

I've used the Perl Database Interface [DBI] in windows running both IIS and apache. Also I've used it under Linux. It works great for me.

Leland Leland F. Jackson, CPA
Software - Master (TM)
Nothing Runs Like the Fox
 
To get form input with perl is easy. The reason that you get confuse is that "There's more than one way to do it". Here's an easy way to get a form data:

#!/usr/bin/perl -w

use CGI qw:)all);

$form_name = param('name');

print header;

print &quot;Hello $form_name<br>&quot;;

In my opinion, all languages may can do what perl can when it comes to web or perl can do anything that the other languages can do, but the reason i'm working with perl is that It makes harder jobs easier or even possible.

There is no Knowledge that is not power.
Age: 16
E-mail: projectnet01@yahoo.com
School: Coral Springs High (Company:(not done yet) :)
Status: Currently working with C++ for game developing. And making a musical band.
-Aaron
 
Well its not trouble using DBI that stumped me, its installing the bloody thing. The instructions are not very detailed. Age: 17
School: Alberta Distance Learning Center
Location: British Columbia, Canada
If at first you dont't succeed, try, try again. - programmer's motto.
 
Well if it's DBI, your hosting company hopefully can help. Yes, PHP will let you connect to mysql fast, but I still believe perl could do it faster if you give it a chance.
There is no Knowledge that is not power.
Age: 16
E-mail: projectnet01@yahoo.com
School: Coral Springs High (Company:(not done yet) :)
Status: Currently working with C++ for game developing. And making a musical band.
-Aaron
 
Building a Web Site is a complicated task because you have many pieces that have to be put into place. It took me a long time to put everything together and know how it all works together. To put an apache web server together with PHP, Perl, and MySQL is a large feat. You will have to learn at least a little about the following:

You’re operating system like UNIX, LINUX, or Windows and how it handles security (e.g. permission).

Your web server and how to configure it. Both IIS and apache have to be configure to know where the cgi-bin is, where the home directory is, what other directories like PHP, etc have execute permission, how to associate an extension with the executable that can run it, etc.

If you want anything more than static HTML you need to know a scripting language like Perl, PHP, Visual Basic, C++, etc.

You need to know how to install your scripting language and to configure your web server to use it. (e.g. the apache httpd.conf).

You probably need to know something about you firewall application.

Be sure and learn how to backup everything relevant to your Web Site.

If you want to use a database you need to know how to create SQL command and how to setup the Web Server to interface with it.

You have multiple layers and I’ve found it usually best to keep them separate. You have the Web Server layer that hangs out in memory to intercept any request coming over an assigned port. It creates threads to serve up Web pages. You have your business logic layer (e.g. the cgi-bin directory). There should probably be nothing in it but executables and perhaps some text files that the executable needs. If you have a perl script in your web’s home directory for example, the browse might try to display it as opposed to executing it. Some Languages allow you to embed script right into the HTML, but the prevailing thinking is that this creates confusion and sloppy programming.

Last you have the data store. It is usually a backend multitasking kind of database.

The web server servers up a stream of HTML to a client browser. The browser knows HTML and sometime a little Java so it displays a form. The form when completed is passed to the web server again creating a new thread. The web server passes the input of the form to your script. The script receives the input and processes it. If the input is to be stored in a database, the script must establish an interface to the backend and pass the data to it. I wish I could simplify it for you, but the complexity involved requires considerable effort. If I were you, I would print out the HOWTO provided by the operating system and begin reading. Then experiment with everything until its all working.

I would try to get one thing working. Once I had it working then I would move to the next thing.

Leland
Leland F. Jackson, CPA
Software - Master (TM)
Nothing Runs Like the Fox
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top