around 'load_objects' => sub { my $orig = shift; my $self = shift; $rcref = Variant(VT_I2|VT_BYREF, 0); return $self->$orig(@_, $rcref); die "error" unless ( $rcref == 0 ); }; #### package Automatic::Check { use MooseX::RoleQR; use MooseX::ModifyTaggedMethods; around methods_tagged('ShouldCheck') => sub { my $orig = shift; my $self = shift; $rcref = Variant(VT_I2|VT_BYREF, 0); return $self->$orig(@_, $rcref); die "error" unless ( $rcref == 0 ); # never happens }; } package SA::Application { use Moose; use Sub::Talisman qw( ShouldCheck ); with 'Automatic::Check'; has ole => ( is => 'ro', isa => 'Win32::OLE', builder => '_build_ole'); sub _build_ole { return Win32::OLE->new("SiebelDataServer.ApplicationObject" or die "failed"; } sub load_objects : ShouldCheck { my $self = shift; my $cfg = shift; $self->ole->LoadObjects($cfg); } }