I second that. :-) Another difference between perl and PHP is which perspective they are using. In PHP you are in essence writing html pages which include code. In (most) perl you are writing perl code which prints html output. (I say most, since you can do PHP-style programming with perl too, embperl and so on).
I'd say the choice also depend on which type of apps you are planning to develop. Small data-driven applications which mainly is data-in data-out via a fancy interface: use PHP. Larger more complex project which may need to include complex string parsing: use perl. If you are going to write *really* large and complex programs (say, in the vincinity of 1 meg source code), install Tomcat and use Java Servlets instead. I would also recommend Java as the better choice if you are learning a first language, since it enforces a good way of thinking. One should also note that whereas PHP is one thing, perl is many. The difference between coding mod_perl, traditional CGI or embperl is quite large. Personally I favor mod_perl in the choice between the above. Finally, it's very easy to write bad programs in any language. :-) Neither perl nor PHP will try to stop you from stupid coding. If you go for perl, I can only (as a programming teacher) recommend you to write "use strict;" in top of each perl file (which enables strict checking of variable declarations and similar). // Joel On Thu, 24 Jul 2003, daniel wrote: > On July 24, 2003 02:24 pm, Patrick Marquetecken wrote: > > I don't want to start a flame, but i'm wondering whats the best language to > > use with apache. I don't know both and going to learn one. I know that perl > > can be used "standalone" of php i don't know. > > perl is amazing. you can write cgi-scripts in it for web forms, write an mp3 > player for your car, or, if given enough time, i'm sure some perl-geeks could > write software for exploratory robots on mars. perl is pretty damn amazing > in terms of its expandability with modules, community support and one of my > favourites: string parsing. perl is GREAT at pulling down content from > sites, ripping through it for info and sorting it any way you like. > > php is WAY easier to use though. connecting to a mysql db is practically > seemless and there's a huge number of built-in functions that are used all > the time in web development that have to be hand written in perl. > > for example, mail() is a php function that sends mail to someone. this > capability is available in perl, but requires much more work on your behalf. > in perl, you have to open a pipe to your mail binary, write to it and then > close the pipe. > > i love perl. it's the shiz-nit when it comes to writing log-parsers, or > system administration tools, but for my money, php is just faster and easier > to use for the web. > > IMPORTANT NOTE: > > php has some serious failings when it comes to programming. it's designed for > sloppy coders, not enforcing namespaces and instead preferring to globalise > your variables etc. if you're looking to learn your first language, don't > let it be php. it gives you some bad habits that can be harder to shake > later on. > > my $0.02 > > -- > writing about music is like dancing about architecture. > - frank zappa > > > -- > [EMAIL PROTECTED] mailing list > > -- [EMAIL PROTECTED] mailing list
