1 / 8

Perl and Catalyst: The Chemistry Just Couldn’t be Any Better.

Perl and Catalyst: The Chemistry Just Couldn’t be Any Better. Josh Poritz. Why do people complain about perl?. perl -e'map {map{print chr }/d {3}/gx }join q{}, split/s/sx,q(0741171151 16032097110111116104101 114 032 080 10 1

aelan
Download Presentation

Perl and Catalyst: The Chemistry Just Couldn’t be Any Better.

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Perl and Catalyst: The Chemistry Just Couldn’t be Any Better. Josh Poritz

  2. Why do people complain about perl? perl -e'map\ {map{print chr }/\d\ {3}/gx }join q{},\ split/\s/sx,q(0741171151\ 16032097110111116104101\ 114 032 080 10 1\ 114 108 032 104 \ 09 70 99 10\ 7 1 0 1\ 1 1 4 0\ 4 4 ) ;' $;=pop;{$.= 0;map{$;%$_ or$.||=$_}2 ..sqrt$;;;+ $.||die$;-j .$/;warn$.. $/;$;/=$.;n until+redo} Given a positive integer argument, display all of its prime factors. print “Just Another Perl Hacker”

  3. But in the case of a web app… • Time-to-market often takes precedent over systematic engineering approach • CRUD/Search/Validation system in just 188 lines of code • Grabs input from eclectic sources: web forms, database, external services, etc. Natural result: text processing dominates application logic. • Platform independence of client & server systems loom essential

  4. TMTOWTDI: The bedrock of perl • “There’s More Than One Way To Do It” (pronounced TimToady) • Language doesn’t tell the programmer how to program. • Write programs the way your brain concocts them; minimal translation needed. • Opposite of Zen of Python: “There should be one – and preferably only one – obvious away to do it.”

  5. TMTOWTDI: Enter Catalyst CONTROLLER: Catalyst plugins

  6. DRY, DRY, DRY – how many times do I need to tell you?

  7. Robust handling of URLs /songs/list/byAlbum?title=love package MusicApp::Controller::Songs; sub list : Local { my ($self, $c, $ord) = @_; my $title = $c->req->params->{title}; ... $c->stash->{template} = ‘songs/list.tt2’; }

  8. Of course, there are plenty of wrong ways to write perl code… http://www.youtube.com/watch?v=KyLqUf4cdwc

More Related