• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Dive Into Perl

Dive Into Perl



A brief intro for Perl. Basic knowledge of programming is required.

A brief intro for Perl. Basic knowledge of programming is required.
For more info contact ralph dot wen at gmail dot com



Total Views
Views on SlideShare
Embed Views



3 Embeds 48

http://www.abluetiger.com 23
http://bluetiger.yo2.cn 16
http://www.slideshare.net 9



Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

    Dive Into Perl Dive Into Perl Presentation Transcript

    • Dive into Perl Ralph Wen Ralph.Wen@gmail.com 4/9/2009
    • while (<>) { print “welcome!n” if /perl/; }
    • #!/usr/bin/perl $_=' dw`m !#cholned!]y z42|]yz45|]yz55|]yz 5g|]yz44|]yz45|-&;tug9& #:lx)L%j-%h-%k-%s-%y-%x(:g ns%x)X, 04//05(zgns%y)1//68(zqshou# ]dZ#-%j'04?6 >0;1-#:2#- %j$6-#l]yz372`|#:  gns)%h<%j<%s<1:%k<%s+%s,%h+%h,3*%y.34-%h<3+%s+%h* %x.01-%k+REKCAHX%k*%hJUST+%h=00'ANOTHER' %jPERL* *=000:%s<%k(zqshouHACKER##: |||qshou#]dZ1l#:';s<s+> <>gme;y/101-130//d; s/(.)/chr(ord($1 )^0x1)/ge; eval ;qaa
    • So what is Perl?
    • Perl is… • A pearl without the ‘a’ • A computer language (Perl) • A interpreter (perl) • Pathologically Eclectic Rubbish Lister • Practical Extraction and Report Language • …but never PERL
    • What’s Perl used for? • Text processing • System administration • CGI and web programming • Database interaction • … and, test automation!
    • What is Perl like?
    • What is Perl like? • High level • General purpose • Interpreted • Dynamic • Fast • Open source • Mature…
    • Perl’s “philosophy” • Scripting, programming, hacking and coding • There's more than one way to do it • Pandora's box • Knowledge socialism • ..and, this guy is the philosopher!
    • Okay, now let’s dive into Perl!
    • Hello World! print ‘hell!’
    • Hello again! #!/usr/bin/perl use strict; use warnings; my $greeting = “Hello Earth!n”; print $greeting; exit;
    • Hello? Hello/World.pm hello_world.pl package Hello::World; #!/usr/bin/perl use strict; use Hello::World; use warnings; print hello(); our $VERSION = ‘1.00’; print hello(quot;Milky Wayquot;); use base ‘Exporter’; =head1 NAME Hello::World - an encapsulation for hello world =cut sub hello { my $target=shift; $target=‘world’ unless defined $target; return “Hello, $target!”; } 1;
    • Just show me the gory details!!
    • Well, get ready! It’s a long and harsh journey!
    • But we’ll be running out of time.. So..
    • You are encouraged to learn the syntax by yourself!
    • Demo – Finding Duplicate Files* • Source code (link) • Demo Video (link) *Courtesy to “Wicked Cool Perl Scripts” by Steve Oualline. For more examples please read this book.
    • Somebody said Perl sucks? • Ugly • Illegible syntax • Hard to maintain • Lack of method signatures • Not a real OOPL For more into refer to What's wrong with Perl?
    • When to use Perl for us? • Processing test results • Installing recurrent builds • Performing repetitive test steps • Integrating different tests • ..and so on and so forth
    • Want more fun with Perl?
    • Online tutorials • perlintro – http://perldoc.perl.org/perlintro.html • perltut – http://perldoc.perl.org/index-tutorials.html • A quick tutorial in Chinese – http://www.cbi.pku.edu.cn/chinese/documents/perl/index.htm
    • Books
    • • Comprehensive Archive Networks • Hosts over 15,400 Perl modules • Has more than 250 mirrors across the world • One-click-install for modules for almost all imaginable tasks
    • User Communities • PerlMonks: – http://www.perlmonks.org/ • use Perl; – http://use.perl.org/ • Perl Mongers: – http://www.pm.org/ • Perl China – http://bbs.perlchina.org/