Created
March 7, 2014 06:35
-
-
Save kan/9406402 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 strict; | |
use warnings; | |
use utf8; | |
{ | |
package Foo; | |
use Mouse; | |
has 'foo' => ( is => 'rw', isa => 'Str', lazy_build => 1 ); | |
sub _build_foo { 'Foo!!' } | |
1; | |
} | |
my $foo = Foo->new; | |
warn $foo->foo; | |
$foo->foo('Bar'); | |
warn $foo->foo; | |
$foo->clear_foo; | |
warn $foo->foo; | |
__END__ | |
Foo!! at hoge.pl line 21. | |
Bar at hoge.pl line 25. | |
Foo!! at hoge.pl line 29. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment