Created
March 28, 2012 12:50
-
-
Save wchristian/2225876 to your computer and use it in GitHub Desktop.
Role test
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
package Bar; | |
use Role::Tiny; | |
sub foo { 1 } | |
1; |
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
package Baz; | |
use Role::Tiny; | |
sub foo { 2 } | |
1; |
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 strictures; | |
package Load; | |
BEGIN{ require Role::Tiny }; | |
use Role::Tiny::With; | |
with 'Bar'; | |
with 'Baz'; | |
print Load->foo(); | |
__END__ | |
output: | |
1 | |
expected: | |
an error of some kind |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment