Class::Template - struct/member template builder |
Class::Template - struct/member template builder
use Class::Template;
struct( rusage => { ru_utime => timeval, ru_stime => timeval, });
struct( timeval => [ tv_secs => '$', tv_usecs => '$', ]);
my $s = new rusage;
package OBJ; use Class::Template;
members OBJ { 'a' => '$', 'b' => '$', };
members OBJ2 { 'd' => '@', 'c' => '$', };
package OBJ2; @ISA = (OBJ);
sub new { my $r = InitMembers( &OBJ::InitMembers() ); bless $r; }
Use '%' if the member should point to an anonymous hash. Use '@' if the member should point to an anonymous array.
When using % and @ the method requires one argument for the key or index into the hash or array.
Prefix the %, @, or $ with '*' to indicate you want to retrieve pointers to the values rather than the values themselves.
Class::Template - struct/member template builder |