This file contains hidden or 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
my $deep_tuple = subtype 'deep_tuple', | |
as Tuple[ | |
Int, | |
HashRef, | |
Dict[ | |
name=>Str, | |
age=>Int, | |
], | |
]; |
This file contains hidden or 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
my $deep_tuple = subtype 'deep_tuple', | |
as Tuple[ | |
Int, | |
HashRef, | |
Dict[ | |
name=>Str, | |
age=>Int, | |
], | |
]; |
This file contains hidden or 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
use strict; | |
use warnings; | |
use Test::More; | |
use Moose::Util::TypeConstraints; | |
use MooseX::Types::Structured qw(Dict Tuple); | |
use MooseX::Types::Moose qw(Int); | |
my $deeper_tc = subtype | |
as Dict[ |
This file contains hidden or 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
use MooseX::Declare; | |
class MyClass { | |
method mymethod(Str $aaa) { | |
return $aaa; | |
} | |
} | |
my $aaa = MyClass->new; | |
warn $aaa->mymethod(['aaa']); |
This file contains hidden or 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
use MooseX::Declare; | |
class MyClass { | |
method mymethod(Str $aaa) { | |
return $aaa; | |
} | |
} | |
my $aaa = MyClass->new; | |
warn $aaa->mymethod(['aaa']); |
This file contains hidden or 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
## doesn't seem to work | |
class MyClass with MyRole => {prefix=>"hello"} { | |
method mymethod(Str $aaa) { | |
return $aaa; | |
} | |
} | |
## Seems to work |
This file contains hidden or 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
method method_with_two_is_param_traits () is Moody | |
is Label(label => 'happy') { | |
return 1; | |
} | |
## Label looks like: | |
use Moose::Role; | |
has label => ( |
This file contains hidden or 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
use MooseX::Declare; | |
role MyRole(Str :$prefix = "test") { | |
around mymethod($aaa) { | |
return $prefix .":". $self->$orig($aaa); | |
} | |
} | |
use MooseX::Declare; | |
role MyMethodTrait { | |
has repeat => (is=>'ro', isa=>'Int', required=>1, default=>2); |
This file contains hidden or 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
subtype PStr, | |
as Parameterizable[Str, Int), | |
where { length(shift) < shift) }; | |
method(Int $length = 10) | |
my_name(PStr[$length] $name) | |
{ | |
return "Hello $name!"; | |
} |
This file contains hidden or 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
John-Napiorkowski-MacBook-Pro:~ johnn$ ssh 192.168.3.8 | |
[email protected]'s password: | |
Last login: Fri Jul 9 10:05:40 2010 from 192.168.1.154 | |
[johnn@lvs2-QA ~]$ ssh fs1 | |
johnn@fs1's password: | |
Permission denied, please try again. | |
johnn@fs1's password: | |
Permission denied, please try again. | |
johnn@fs1's password: | |
Permission denied (publickey,gssapi-with-mic,password). |