Linux, Perl and Web development |
Sat Oct 11 22:55:35 CST 2008发表于Delicious/tag/mysql |
|
|
| 阅读全文... |
本站相关内容:(RSS) |
Web site development with Linux, Apache, MySQL, PHP, Perl, Python (LAMP) and other open-source softwareWeb site development with Linux, Apache, MySQL, PHP, Perl, Python (LAMP) and other open-source software |
Perl as a Web Scripting LanguageHad I not been at work, I might have nearly fallen off my seat laughing as I read item #3 in You Used Perl to Write WHAT?! on page 2. You see, the author is taking about where Perl is good and bad, and he says "there are some uses that just aren't right." That' followed by a list of items. Here's number three. As a Web scripting language: One of the earliest usages of perl, as the Web evolved, was for CGI programming webpages. As a result, perl has some pretty strong packages for dealing with Web forms. There is also support for embedding perl into HTML in the same way the Java is embedded into JSP pages. However, I would argue that more modern Web scripting languages, such as PHP and Ruby on Rails, offer more out-of-the-box Web support and a cleaner integration into the webpage experience. You should especially avoid using perl for traditional CGI-style form processing; this code tends to be hard to read and maintain because the HTML ends up inlined inside the perl code. Uhm, WHAT?! Now maybe it's the fact that I started coding in Perl about 12 years ago. Or maybe it's the fact that I've used it quite successfully in various web projects over the years. But suggesting that Perl isn't a good web scripting language is rather laughable. Seriously. Now, if you're starting from scratch and looking to learn a new language primarily for building web applications, that's one thing. Sure, look at PHP, Ruby, Python, and whatever else can do the job. But the author seems to be saying that it's worth learning yet another language simply for building web applications. That's messed up. Have a look around CPAN and at the web frameworks that exist around Perl and mod_perl. Heck, some of them have been around a long time and are quite mature. Saying that Perl "has some pretty strong packages for dealing with Web forms" doesn't really capture the true state of things. I think programming language battles are as dumb as the next person, so I generally try to avoid them. But when I see stuff like this, it's hard to keep my mouth shut. As for the claim that traditional CGI-style form processing being hard to read and maintain... WHAT?! There's nothing hard about separating the HTML from the code. Okay, enough of my griping... Thanks to the folks at TechCzar for translating my tech blog posts and including them in their blog network. ( comments) |
互联网相关内容: |
| Affordable Linux Web Hosting Apache, PHP, PERL, Python, Ruby On Rail, Mysql Web Hosting (2008年04月12日) |
| Web site development with Linux, Apache, MySQL, PHP, Perl, Python (LAMP) and other open-source software (2008年10月31日) |
| MySQL and Perl for the Web (2007年11月20日) |
| Web Interfaces in MySQL with Perl (2008年01月18日) |
| Perl as a Web Scripting Language (2008年01月25日) |
| IWL: A Perl widget library for the web (2007年10月16日) |
| MySQL through the Web with Perl::CGI (2008年02月26日) |
| Web Reporting with MySQL, CSS and Perl (2008年05月12日) |
| Perl - web app - mysql database (2008年11月03日) |




