use warnings; use strict; use Foo; use Bar; my $foo = new Foo; my $bar = new Bar($foo); $foo->x("from program"); print "(app) Memory: $foo, X: ".$foo->x()."\n"; $bar->show();