Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 6th, 2005, 11:56 PM   #1
bae
Newbie
 
Join Date: Apr 2005
Posts: 17
Rep Power: 0 bae is on a distinguished road
php and perl/cgi

what are the advantages for using php over perl/cgi (and vice versa)

is there really much of a difference?


thanks.
bae is offline   Reply With Quote
Old Aug 7th, 2005, 3:22 PM   #2
Lich
Professional Programmer
 
Lich's Avatar
 
Join Date: May 2005
Location: Detroit
Posts: 254
Rep Power: 4 Lich is on a distinguished road
Send a message via AIM to Lich Send a message via MSN to Lich
PERL is a unix scripting language adapted for web programming. PHP was built to be a web programming language. PERL is more powerfull and can do alot of tasks non web related, like any other shell scripting. You can do that with PHP, but PERL is more suited for it.

Because the programming language and syntax are easier, and you don't have any screwy permission problems like you can get in PERL, I reccomend using PHP over perl for web programming
Lich is offline   Reply With Quote
Old Aug 8th, 2005, 8:24 AM   #3
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
I second PHP for web programming.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Aug 8th, 2005, 10:53 AM   #4
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Quote:
Originally Posted by Lich
PERL is more powerful
Not necessarily. For example, Perl doesn't have built-in support for database access using MySQL, PostgreSQL etc. It depends on what you're doing, I guess.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Aug 8th, 2005, 12:59 PM   #5
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
Yeah... really no one good language for everything. The problem / assignment usually dictates which language would be best suited.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Aug 8th, 2005, 6:12 PM   #6
BlazingWolf
Hobbyist Programmer
 
Join Date: Sep 2004
Posts: 207
Rep Power: 5 BlazingWolf is on a distinguished road
IR is right no one langauge is good for everything thats why we have different ones.
__________________
_______________________________
BlazingWolf
BlazingWolf is offline   Reply With Quote
Old Aug 9th, 2005, 9:36 AM   #7
Lich
Professional Programmer
 
Lich's Avatar
 
Join Date: May 2005
Location: Detroit
Posts: 254
Rep Power: 4 Lich is on a distinguished road
Send a message via AIM to Lich Send a message via MSN to Lich
Quote:
Originally Posted by Ooble
Not necessarily. For example, Perl doesn't have built-in support for database access using MySQL, PostgreSQL etc. It depends on what you're doing, I guess.
True, but I was referring to overall, as a language, all the stuff it can do. When it comes to web specific applications php owns perl
Lich is offline   Reply With Quote
Old Aug 9th, 2005, 11:09 AM   #8
prolog
Programmer
 
Join Date: Jul 2005
Location: Germany
Posts: 69
Rep Power: 4 prolog is on a distinguished road
Hi,

i seriously doubt that. Could you please state why php is better for webstuff ?
__________________
-= C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do succeed, you will blow away your whole leg. =- Bjarne Stroustrup
prolog is offline   Reply With Quote
Old Aug 9th, 2005, 11:45 AM   #9
Lich
Professional Programmer
 
Lich's Avatar
 
Join Date: May 2005
Location: Detroit
Posts: 254
Rep Power: 4 Lich is on a distinguished road
Send a message via AIM to Lich Send a message via MSN to Lich
Because PHP was built as a web programming language. The structure, built in functions, and everything else is made for internet applications, it's the main purpose of php.

PERL, on the other hand, has been around since the 80s and was, and still is, a unix scripting language. somwhere along the line people decided to allow web servers to execute the perl scripts for interactive web pages. The main purpose of perl, has always been to script, they just adopted it because it was the best solution at the time.
Lich is offline   Reply With Quote
Old Aug 9th, 2005, 12:00 PM   #10
prolog
Programmer
 
Join Date: Jul 2005
Location: Germany
Posts: 69
Rep Power: 4 prolog is on a distinguished road
Hi,

thanks for the details. As you say perl is around some time. The same goes for cgi. cgi again is a layer that allows one to use what ever language you whish to accomplish some dynamics. I agree that perl was not made for web-programming, but that does not mean that it's bad for such things. PHP is a scripting language as well. Just because the zend-engine and the parser does some housekeeping for you which you'd have to do by hand in perl, it does not mean that php owns perl. Because aside from this little tricks, php has nothing to offer. And as the template-concept is widely used perl has some major advanteges over php as it was made for textprocessing. See the template engines in php and compare them to one written in perl. But when it comes to real work, aside from just outputting some values like greetings and such, perl offers way more possibilities to structur and organize your code. And as there is something called fast-cgi the performance-difference isn't that bad. perl is a mature and well designed language and as such i prefer it over php for real web-applications. Let's say shop-systems or cms or even a front-end for an ai-based resource-optimizer .. controlling loadbalancers for highperformance servers. One can hardly do that in php. But as said, every language may have it's right of existence even brainfuck.
__________________
-= C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do succeed, you will blow away your whole leg. =- Bjarne Stroustrup
prolog is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:21 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC