SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.
SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.
Successfully reported this slideshow.
Activate your 14 day free trial to unlock unlimited reading.
2.
About Me
Ynon Perek
me@ynonperek.com
This keynote is available at:
http://ynonperek.com
Tuesday, September 18, 12
3.
Meta Who
Person Keynote
has many
Tuesday, September 18, 12
4.
Meta Who
Meta-Person Meta-Keynote
Person Keynote
has many
Tuesday, September 18, 12
5.
Meta Class
What can my class do ?
What does my class know ?
Tuesday, September 18, 12
6.
Meta Zombie
package main;
my $z = Zombie->new;
while (chomp ( my $that = <> ) ) {
my $m = Zombie->meta->find_method_by_name("eat_${that}");
$m->execute($z) if $m;
}
Tuesday, September 18, 12
8.
Useful Meta
MooseX::HasDefaults::RO
Assign a meta-role to every attribute
which adds:
is => ‘ro’
Uses _process_options
Tuesday, September 18, 12
9.
Useful Meta
MooseX::FollowPBP
Automatically set reader and writer to
get_name and set_name
Tuesday, September 18, 12
10.
Useful Meta
MooseX::Privacy
Private Methods Using
meta
Tuesday, September 18, 12
11.
MooseX::Privacy
use MooseX::Privacy;
has config => (
is => 'rw',
isa => 'Some::Config',
traits => [qw/Private/],
);
private_method foo => sub {
return 23;
};
Tuesday, September 18, 12
12.
A few more
package MyApp;
use MooseX::Singleton;
MooseX::Singleton
package main;
MooseX::YAML my $instance = MyApp->instance;
my $same = MyApp->instance;
Tuesday, September 18, 12