Last active
December 24, 2015 02:59
-
-
Save prakashk/6734791 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use v5.14; | |
use mop; | |
class Foo { | |
has $!sentence is ro; | |
method new($class: @words) { | |
$class->next::method(words => \@words); | |
} | |
submethod BUILD($args) { | |
$!sentence = join " ", @{$args->{words}}; | |
} | |
} | |
say Foo->new(qw<mop is cool>)->sentence; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment