#! /usr/bin/perl use strict; use warnings; use lib qw(.); use Variable; use Adder; use Sqrt; my $alpha = Variable->new(); my $beta = Variable->new(); my $gamma = Variable->new(); my $delta = Variable->new(); my $adder = Adder->new(); my $sqrt = Sqrt->new(); $alpha->connectAdder($adder); $beta->connectAdder($adder); $adder->connectSum($gamma); $gamma->connectSqrt($sqrt); $sqrt->connectRes($delta); $alpha->setValueAdderVar(3); $beta->setValueAdderVar(4); print $delta->getValue(),"\n";