7. Line Noise /
Write Only
Ugly
Only good for Scripts
There are Better
Not Modern Options
Fine for Text Processing
Perl Is Dead
Hard To Learn
Terrible Docs
CPAN is Busted!
8.
9.
10. For me, Inspiration is
helping someone
construct their own
version of the idea,
which is appropriate to
their needs and
conceptual context.
24. A Reusable Object
package HelloName;
use Moose;
has name => (is=> "ro", required=>1);
sub hello {
my ($self) = @_;
return "Hello ".$self->name;
}
1;
25. Using Your Object
#!/usr/bin/env perl
use Modern::Perl;
use HelloName;
my $obj = HelloName->new(name=>shift);
say $obj->hello;
29. Testing
use HelloName;
use Test::Most;
my $obj = HelloName->new(name=>'John');
is $obj->name, 'John';
is $obj->hello, 'Hello John';
done_testing;
30. $ prove -v hello-name.t
hello-name.t ..
ok 1
ok 2
1..2
ok
All tests successful.
Files=1, Tests=2, 0 wallclock secs
Result: PASS
31. As a Website
use Modern::Perl;
use HelloName;
my $obj = HelloName->new( name =>
$ENV{HelloName_name} );
my $app = sub {
return [
200 => [ "Content-Type" => "text/plain"],
[ $obj->hello ],
];
};
36. How To Learn More
• Modern Perl book
• Task::Kensho
• perl.org
• Books (Catalyst Book)
• IRC and Mailing lists
37. Classes 2 - 8
• Perl: History, ecosystem, community and installing.
• More Perl than I got paid to know at my first job.
• Creating your first Perl Application and following
community standards.
• Perl: Review idioms and common solutions.
• Objects: Moose, strategies for reusability.
• Working: Building the Guestbook Application
• Summary: Review, things to avoid, where to go next.
41. “Perl was always
designed to be an
Evolving Language”
- Larry Wall, Original Perl Language Designer
42. Student Feedback
• Liked implicit arguments and return values.
• Neutral on syntax and $@%*.
• Appreciation for cpanm, local::lib, perlbrew.
• Plack is a hit...
• ...and so was Moose!
43. Stumbled a bit on installing Perl and CPAN modules, and
a bit of trouble understanding local::lib.