Advertisement

PHP or Perl/CGI

Started by October 02, 2001 09:26 PM
5 comments, last by tikzin 23 years, 1 month ago
I know this is not 100% game programming but I bet some of you will have an idea or some words of advice. Right now I want to be able to create dynamic pages that are created through a scripting language and a database. The two lanuages i want to use is PHP and Perl/Cgi but im not sure which language I should use first. Which one is easier? Will it take long to learn them? Do you know of sites that have information about these languages? Thanks for your help in advance....... Tikzin - Stonecrick.com
Tikzin - Stonecrick.com
PHP is a little more structured, and tries to correct some of the perceived deficiencies of Perl. Perl is perfect for quick and dirty solutions - it was originally a sysadmin tool, designed to quickly provide solutions to repetitive tasks (which is why it mirrors so many UNIX commands internally) - while PHP seems a more elegant language for large, structured solutions. Both have excellent database support, so it comes down to your personal style. PHP can encapsulate your HTML (and be interspersed with it) while doing the same with Perl is far more difficult.

I think PHP also solves that process spawning thing with CGI: every request handled by Perl/CGI requires a new process to be spawned while PHP is an in-proc solution. Other than that, it comes down to preference.
Advertisement
Ok thanks

Tikzin - Stonecrick.com
Tikzin - Stonecrick.com
It really depends on what you want to do and what your background is. If you have any prior knowledge in C/C++, I''d start with PHP. The languages are extremely similar. You''ll fall right into place with websites like:

http://www.php.net/

http://www.phpbuilder.net/

As far as Perl goes, it''s probably more powerful, (I don''t use it much) and more widely used, but it''s not as easy to learn.

Whichever way you go, use your own judgement. No one can tell you how to program. Your style is all your own.
DracosX:Master of the General Protection Fault
PHP all the way! Baby yeah!

While Perl had web features grafted on to it via CPAN libs, PHP was created for the web and therefore does it better, IMO. Also you get the best of both world, since PHP is similar to Perl. Oh yeah, PHP also does OOP natively, instead of ad-hoc like Perl.

I''m using PHP now and loving it, though the $ gets VERY old VERY quickly. It''s the biggest syntax error. Unlike Perl, where scalar v. vector context matters, they''re useless in PHP.

What I like is being able to mix CODE into the HTML, instead of HTML into the CODE. That''s one of the best bloody features, second only to persistent session variables (think server side cookies)! It''s a fine alternative to ASP, though ASP does somethings better.

The only thing missing is exception handling, since I''d like an elegent way to catch my errors. Basically in PHP, if you get an error, it prints the error message for you (which isn''t exactly end user friendly and sometimes you want to output a customized message). But at least it continues gracefully.

If you''re running window, download PHPTriad. It installs damn near everything you need. You get PHP, MySQL, PHPMyAdmin, Apache, and as of recently, Perl. This gives you an opportunity to try both. BTW, the install is brainless, literally. You run the EXE and a message pops up saying it''s done a few seconds later--no input, no loading/progress bar, nothing on the screen.

Jinushaun
Nation Leprechaun
PHP is probably the better choice. Its a great thing to know in web design today. I plan on learning it after I can make good games in C++ but untill then, HTML< Flash 4 and 5, java-script, CSS, and CGI seem to work well enough. I don''t like how CGI needs special support from the server though, so I don''t use it much. I don''t know enough about PHP to know if its the same, but I do no alot of people who are hiring me nowadays are looking for PHP and CGI scripts. PHP seems to be a bit more organized.
------------------------------Put THAT in your smoke and pipe it
Advertisement
Wow...you guys have been really helpfull. Thanks for all thee info. Ive decided im going with PHP...............

This topic is closed to new replies.

Advertisement