12 sub new { bless {}, shift }
19 use Class::Struct 'struct'; # test out both forms
21 use Class::Struct SomeClass => { SomeElem => '$' };
23 struct( s => '$', a => '@', h => '%', c => 'aClass' );
29 print "not " unless $obj->s() eq 'foo';
34 print "not " unless ref $arf eq 'ARRAY';
37 $obj->a(2, 'secundus');
39 print "not " unless $obj->a(2) eq 'secundus';
44 print "not " unless ref $hrf eq 'HASH';
49 print "not " unless $obj->h('x') == 10;
54 print "not " unless ref $orf eq 'aClass';
57 print "not " unless $obj->c->meth() == 42;
60 my $obk = SomeClass->new();
64 print "not " unless $obk->SomeElem() == 123;