Created
April 15, 2010 19:01
-
-
Save j1n3l0/367501 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 5.10.0; | |
use warnings; | |
{ | |
package Foo; | |
use Moose; | |
local $SIG{__WARN__} = sub { }; | |
has private => ( isa => 'Int' ); | |
has bar => ( | |
isa => 'Int', | |
is => 'rw', | |
trigger => \&update, | |
); | |
sub update { say 'the value of bar is ', shift->bar } | |
no Moose; | |
1; | |
} | |
my $foo = Foo->new(); | |
$foo->bar($_) for 1 .. 5; | |
warn 'warns but does not die'; | |
exit 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how to switch off warnings in a moose class (if you must), see here for motivation