say "begin block to change"; use Carp; my $self = \%self; for my $property ( keys %self ) { if ( exists $param_hr->{$property} ) { say "property is $property"; my $type = ref $param_hr->{$property} || 'zilch'; say "type is $type"; my $expected_type = ref $self{$property} || 'zilch'; say "expected type is $expected_type"; croak "$property should be a $expected_type" if $expected_type ne $type; say "did execution get here?"; $self{$property} = delete $param_hr->{$property}; } } say "after block to change, self is";