use MooX::Struct Point => [ 'x', 'y' ], Point3D => [ -extends => ['Point'], 'z' ], ; my $origin = Point3D[ 0, 0, 0 ];