Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Class::Tiny multiple inheritance?

View miclasstiny.pl
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
package Blah;
 
use strict;
use warnings;
use Class::Tiny qw(blah);
sub bla {
my ($oh, @ah) = @_;
return join(' ', ucfirst($oh->blah), @ah);
}
 
1;
 
package Argh;
 
use strict;
use warnings;
 
use Class::Tiny qw(argh);
 
sub arg {
return uc($_[0]->argh);
}
 
1;
 
package Oh;
 
use strict;
use warnings;
use parent -norequire, 'Blah', 'Argh';
 
use Class::Tiny qw(oh);
 
1;
 
package main;
 
my $b = Oh->new(blah => 'blablabla', argh => 'aargh!', oh => 'ohh!');
print $b->bla('bla', 'blaaa!', $b->arg, $b->oh) . "\n";
print Oh->isa('Blah') . ' ' . Oh->isa('Argh') . "\n";
 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.