#!/usr/bin/perl -w use Class::Struct; struct Person => { name => '$', age => '$', }; struct Family => { head => 'Person', address => '$', members => '@', }; { my $folks = Family->new(); my $dad = $folks->head(); print "dad = $dad , its a " . ref($dad) . "\n"; $dad->name("John"); $dad->age(34); }