package Sqrt; sub new{ my ($class) = @_; my $self = {}; bless $self,$class; return $self; } sub connectRes{ my ($self,$var) = @_; $self->{Result} = $var; } sub refresh{ my ($self,$val) = @_; $self->{Result}->setValue(sqrt($val)); } 1;