Originally posted by jacobelias
What are the differences bwtween PHP and Perl?
PERL was designed by Larry Wall in order to develop a language that allowed for the easy automation of system asministration tasks. However, Larry included a way through packages for the langauge to be expanded and since it became a standard in the *nix world it grew very rapidly as was one of the first languages brought into common use for cgi programming.
PHP was designed by Rasmus Lerdorf for use as a scripting language on the internet.
As for the actual differences between them, they are vast in some areas and miniscule in others. It boils down to the fact that they are different programming languages with different strengths and weaknesses. If I were writting a script to run on a *nix box with a command line interface I would use PERL, if I were writting a windows app I'd use C++ or C#, if I were writting a web app I'd use PHP unless I were on a windows box in which case I'd use ASP and if I were on a webspere server I'd use JSP. It's all about choosing the right tool for the job.
As far as speed goes. If you use standard perl to power cgi applications then PHP is faster but only because of the overhead of start up with PERL. standard PERL fires up a new version of the engine with each script that is run, whereas PHP says resident in the webserver's memory space. However, if you use mod_perl then this obsticale is overcome and PERL runs at a comprable speed to PHP.
On the other hand OO methodologies are tacked onto PERL not an intrisic part of the language as with PHP. This being the case it is much more difficult to write objects in PERL. For example I have been a professional PERL programmer for 5 years and I would not even attempt to create database packages that allow for all dataaccess rutines to write themselves by the information they get from the database. However, I have only been programming in php for 1 year and I already have such a package for php.
On the other hand I have a perl script that will use a text file to back one database up to another database and I wouldn't want to rewrite that in PHP, expecially since it doesn't use a web based interface.
Like JSP is Sun Microsystems and ASP is Microsoft's
PHP is from which company?
JSP, ASP & PHP are all implementations of the same theory. The difference is pretty much their base language. JSP uses java, PHP uses C and ASP is langauge independent. What do I mean by this?
JSP is written in java. You inport a couple of libraries that allow for the jsp stuff as an add on to java and then you just program in java. Then the server compiles the programs on first run and the java class files are used from then on out. It is pretty widely acepted that JSP is an outdated technology.
PHP is a languaged derived from C++, and therefor sharing a lot of syntax with C++ and other C derived languages like PERL and Java. However it is still it's own language. In a PHP script all of the 'code' will be in PHP.
ASP is an engine, a means of mixing server side scripting in with the HTML in much the same way that php works. However since ASP is little more then a suite of protocols you can use various languages and still be programming in ASP. The two most commonly used languages are VBScript (VBS) and JavaScript Server Side (JSSS) more recently many ASP scripts are being written in C#.
For continued reference:
JSP
- http://java.sun.com/products/jsp/
- http://www.jspin.com/
- http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/
ASP
- http://www.asp.net/Default.aspx?tabindex=0&tabid=1
- http://www.asp101.com/
- http://www.aspin.com/
PERL
- http://www.perl.com/
- http://www.perl.org/
- http://www.cpan.org/