Forum Moderators: phranque
Of them all, I like PHP best.
The syntax of PHP is the most similar to Javascript (EMCAscript), so if you're a browser-manipulating JS jockey or even a Flash Actionscripting whiz, you're going to pick up PHP in no time flat.
And since you're using MySQL, you'll find the built-in MySQL functions in PHP will make your work much easier.
The Web is filled with open-source PHP scripts that do everything except wash your shorts.
and PHP is open source. Free. No $$.
Need I say more?
My husband went to buy a PHP-MySQL book last week and found all they had was Perl-MySQL, so he was wondering if Perl was more popular.
Then I went to a different bookstore over the weekend and all they carried was PHP-MySQL books and no Perl-MySQL books. So we thought we'd turn to all you the sages at WebmasterWorld to see what was more popular.
Thanks again for the advice!
I'm a Perl addict myself and i've got a script that washes the shorts of the entire block, brews coffee on the space shuttle and makes sure the rain is wet. No cron needed, it runs off a wristwatch as it's just one line of code.
Although this might sound impressive i have recently - last week actually - bought a few books on php and mysql myself. I can do things in perl (one never even "knows" it, it seems), but lately i have found that i need mysql. I don't know any mysql in advance, so i basically had the choice between learning a whole new language (PHP) or learning a new side of Perl to query and manage databases. I chose PHP as i do think it will be easier for me to learn mysql and php (from scratch) than mysql and some more perl.
>> popular
Php is definitely more popular in some circles than Perl. Otoh, Perl is more powerful and flexible. Don't let that influence your decision though. Perl is a pain to learn, as there's so many ways of doing the same things and that's just not what you need when you want to learn something new. Plus if you plan on working with others, go for PHP - in Perl your code tends to become personal and hard to read for others (oh, and for yourself too if it's been some time since you wrote it).
/claus
"The Web is filled with open-source PHP scripts that do everything except wash your shorts." --httpwebwitch
"Actually, I've got a script written in PHP that does that. I have it running from the command line as a cron job ;)" -- Nick_W
"I'm a Perl addict myself and i've got a script that washes the shorts of the entire block, brews coffee on the space shuttle and makes sure the rain is wet. No cron needed, it runs off a wristwatch as it's just one line of code." -- claus
ROFLWTIME! ;..D
Jordan
To add my vote: Go for php. I love perl, but I'd suggest php to ease the learning curve and get up to speed quickly. I don't think it is true taht perl has dwindled in popularity and php has taken over; I think Perl is as popular as it ever was for certain sorts of developments. e.g. For general development such as integration of legacy systems (not saying it is not powerful for web development). But for integration with a database using opensource, the defacto standard combination competing with Microsoft ASP is LAMP (Linux, Apache, MySQL, Php).
Very interesting, because that's an area where php performs better than perl. It's takes less "overhead", runs faster, and can handle more simulatenous users. Perl has its strengths but in other areas.
LOL. That conveys a pretty clear picture. :-)
I still remember having have bad dreams about registers and branch instructions from my college assembler class assignments not working right. So these days I'm interested in languages that are not excessively complex to learn.
So, you think php has not overtaken perl in popularity for webpage development
Very interesting, because that's an area where php performs better than perl. It's takes less "overhead", runs faster, and can handle more simulatenous users
[webmasterworld.com...]
I pointed out that most people are using Perl through CGI where most people who use PHP are not. That's why PHP is generally accepted as being faster. Please re-read my post for a better understanding of what I said.
Let me be a (but not *the*) voice of reason:
In the end, it comes down to preference. I prefer PHP, but Perl is actually not too different. There are differences - but knowing PHP you should be able to read most Perl code and vice-versa -- or at least get an inkling about what's going on.
People will go on for days about performance differences. It will be a minute difference for most applications. Just rest assured that PHP and Perl (w/ MySQL or Postgres) on a Unix/Linux/Sun server will run faster than ASP/ASP.NET on a Microsoft server.
I recommend PHP for beginners. Perl is handy to know, and if you choose to administer your own server, or have to doll up scripts you grab off the Web, it's practically a must. You can survive without it.
Before all that, though, the test setup will have to be working in such a way that it measures what you are intending to measure, and nothing else. So, there's two sides to this (as to all research): Measuring accurately, and measuring the right thing.
Calling perl off a cgi and not calling php off a cgi is comparing two things that are not equal. You will want to device a method for measurement in stead that does not depend on the way the program is called, but on the progam itself. If this is not feasible for some reason you cannot compare directly, in stead you have to make indirect measurement.
Here, you can eg. compare the amount of code-lines required to perform same tasks, or the amount of running processes and the memory allocation on the server during program execution.
I have just recently gone from being php-ignorant to being php-newbie, so of course i do not know phps abilities in these areas but i know that advanced perl code can do a very good job on all. Nevertheless, if php should turn out to have limited possibilities here, you'll have to write a perl program that is just as limited to compare properly.
My claim, in stating that Perl was definitely faster, was not a direct comparison either, i have to admit that. What i should have said was, that whatever application one chooses to build in php and however it's built, there will be a way to build it in perl that will be more efficient. I firmly believe that Perl simply has more methods for doing all kinds of (and more) things than php and that alone tells me that Perl will continue where php stops.
Most of the good people in here will never-ever find themselves in a situation where it's really necessary to choose perl in stead of php. But it might be so the other way round, as when working in teams with others, where php definitely has advantages (more structured and hence more readable code, cvs, and so on).
/claus