Web Development in Perl
Upcoming SlideShare
Loading in...5
×
 

Web Development in Perl

on

  • 27,863 views

This was my presentation during WebOSS '07, the first Web and Open Source Technology Conference in Kolkata, on 13th October 2007

This was my presentation during WebOSS '07, the first Web and Open Source Technology Conference in Kolkata, on 13th October 2007

Statistics

Views

Total Views
27,863
Views on SlideShare
27,674
Embed Views
189

Actions

Likes
4
Downloads
335
Comments
2

11 Embeds 189

http://perlbabu4m.blogspot.com 80
http://www.perlbabu4m.blogspot.com 34
http://www.slideshare.net 33
http://www.perlbabu4m.blogspot.in 12
http://perlbabu4m.blogspot.in 10
http://journal.naveeng.com 6
http://yangsw.tistory.com 5
http://vioan.blogspot.de 3
http://vioan.blogspot.com 2
http://yangsw.net 2
http://perlbabu4m.blogspot.com.br 2
More...

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • @Dave, perhaps you can point out to a specific new presentation
    @Naveen it will be great If by any chance you have made a newer version of the presentation and can provide us with a link
    Are you sure you want to
    Your message goes here
    Processing…
  • Please don't read these slides. Twelve years ago they would have been great, but while Perl web development has moved on, this author's understanding of it apparently hasn't.

    You would be much better advised to look for an introduction to PSGI/Plack.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Web Development in Perl Web Development in Perl Presentation Transcript

  • WEB DEVELOPMENT IN Perl Naveen Gupta nkrgupta@gmail.com
    • AGENDA
      • Introduction to Web Development & Perl
      • Perl Powered Sites/Application
      • Basic Web Programming in Perl
      • CGI Programming in Perl
      • Creating HTML Forms
      • mod_perl
      • Templating Systems in Perl
      • Web 2.0 Applications in Perl
      • Perl vs PHP - A Tale of 2 Languages
    • Introduction to Web Development
    • What is Web Dev?
    • – Development of websites, internet applications, e-commerce sites, social networks etc.
    • – Includes Web Designing, Content Development, client/server side coding, Web Server configuration
    • – Flexible Model, easy to adopt to, Barriers to entry very low
    • – Contributing Factors - Propagation of Open Source Technologies, WYSIWYG Tools, Internet Awareness
    • – Killer Apps – Google Docs, Flickr, WordPress, PhpBB, WikiMedia, YouTube and millions others
    • Dominant Technologies
      • C, C++, Pascal, Shell Script
      • ASP
      • JAVA, J2EE and related Frameworks
      • Perl with or without CGI
      • PHP
      • .NET – C#, VB.NET
      • Python
      • Ruby on Rails
      • ColdFusion
    • Introduction to Perl
      • Created by Larry Wall in 1987
      • Interpreted, Scripting Language
      • C - like syntax
      • Best of C, awk and sed
      • Best language for Text Manipulation/ Data Processing
      • Swiss Army knife for SysAdmins, Programmers
      • Supports modules, OO, DB interaction, pointers, regular expressions, multithreading, sockets, MVC frameworks
      • Highly Portable, well documented
    • Perl and the WEB
      • De facto language for CGI Programs
      • Made popular by Matt’s Script Archive
      • Easy to build and maintain
      • Wide acceptance of LAMP framework – Linux, Apache, MySQL, PHP/Perl/Python/Ruby
      • Great DB support via DBI set of Modules
      • Strength of Perl – CPAN, Comprehensive Perl Archive Network
      • Hands down winner with the advent of mod_perl, FastCGI, Catalyst, Moose etc.
    • How to get Perl?
    • - For *NIX Platforms – Included with almost every Linux, BSD, Solaris, OS X installation. Source can be can be downloaded from http://www.perl.org and compiled using “ gcc”. RPMs are also available.
    • - For Windows Platforms – Installation Binary distributed by http://www.activestate.com as ActivePerl. Yet, complete LAMP installations distributed by http:// www.apachefriends.org , http://www.apache.org , http://www.indigostar.com etc. are most popular. Complete listing can be found at http://www.perl.org/ports
    • Perl Powered Sites/Applications
    • My First Web Program in Perl
    #!/usr/bin/perl print “Content-type:/text/html ”; print “Hello World!<br>”;
    • Adding a Bit of `Perl`
    #!/usr/bin/perl print “Content-type:/text/html ”; my $time= localtime ( time ); print “Today is $time <br>”; foreach my $key ( sort keys %ENV){ print qq{$key = $ENV{$key} <br>}; }
    • Jazz it up with a little HTML
    #!/usr/bin/perl print “Content-type:/text/html ”; print “<h1>Welcome to my First Perl Web page</h1>”; print “Perl is a great language!<br>”; print “It can create killer websites too!<br>”; print “Wanna see how?”;
    • Here Document
    #!/usr/bin/perl print “Content-type:/text/html ”; print <<HTML; <h1>Welcome to my First Perl Web page</h1> Perl is a great language!<br> It can create killer websites too!<br> Wanna see how? HTML
    • Going Dynamic with CGI
    #!/usr/bin/perl use CGI; use strict; my $cgi=new CGI; print $cgi->header(); print $cgi->start_html(-title=>’First CGI.pm program’, -meta=>{‘keywords’=>’perl cgi’, ‘ copyright’=>’WebOSS ‘07’}, -style=>{‘src’=>’style.css’}, -BGCOLOR=>’blue’); contd….
  • … contd Going Dynamic with CGI print $cgi->h1(“Welcome to a CGI APP!”); print “Your IP Address is : ”.$ENV{‘REMOTE_ADDR’}.“<br>”; print “You have been directed here from: $ENV{‘HTTP_REFERER’}” ; print $cgi->a({-href=>’http://search.cpan.org’, -target=>’_blank’}, “Go to CPAN!”); print $cgi->end_html;
    • The Power of mod_perl
    • “… mod_perl  is more than CGI scripting on steroids. It is a whole new way to create dynamic content by utilizing the full power of the Apache web server to create stateful sessions, customized user authentication systems, smart proxies and much more. Yet, magically, your old CGI scripts will continue to work and work very fast indeed. With mod_perl you give up nothing and gain so much! …” – Lincoln Stein, Author – CGI.pm
    • - Perl Interpreter embedded in Apache
    • - Overcomes one-process-per-request limitation of CGI, 100x faster!
    • - Write Apache modules in Perl instead of C
    • - Hundreds of Modules available in CPAN
    • - Numerous Application Frameworks, Templating Systems
    • - Configure Apache’s httpd.conf via Perl
    • Perl Templating Systems
      • HTML::Mason
      • Template Toolkit
      • HTML::Template
      • SSI using mod_include or Apache::SSI module
      • Why use Templating System?
      • Consistency of Appearance
      • Reusability
      • Abstraction between logic and design
      • Division of Labour
    • Web 2.0 Apps in Perl
      • CGI::Ajax
        • Object Oriented module by Brian C. Thomas
        • Eliminates the need to write JS for AJAX Calls
        • Generates JS Functions from output by Perl subroutines
        • Can be implemented in large projects
        • HTML::TagCloud
        • Generates Tag Clouds, with different font sizes
        • CSS Based
        • Add method takes 3 arguments – a) Tag Name
            • b) URL to link to
            • c) Weight
  • WEB DEVELOPMENT IN Perl Perl vs PHP
  • APACHE INTEGRATION DOCUMENTATION API/ LIBRARY SUPPORT LEARNING CURVE PURPOSE/ UTILITY mod_php mod_perl, Fast CGI http:// www.php.net Perldoc, http:// perldoc. perl.org , CPAN PEAR and PECL, both from http://www.php.net 48606 active modules on CPAN and many others elsewhere Easier than Perl Easier than C, JAVA, .NET Made primarily for WEB. Can do CLI and other tasks. Multi-purpose, primarily for text pocessing, equally suited for sysadmin and web apps PHP Perl
  • WordPress, phpBB, Drupal, Coppermine, phpMyAdmin AWStats, Slash Code, BugZilla CMS / APPLICATIONS Yes, the main reason for its popularity Only with Modules like Mason, HTML::Template, Template::Toolkit etc. HTML EMBED PHP Perl
    • THANK YOU!
    • use Perl;