package SynopsisTable; sub new{ return bless {names=>'', info=>{}}; } sub declare{ my($self,$name,$key,$type) = @_; if ($self->{names}) { $self->{names} .= ",$name"; } else { $self->{names} .= "$name"; } $self->{info}{$name} = "$key,$type,"; } sub set_synopsis{ my($self,$name,$synopsis) = @_; my($key,$type,$unused) = split ',', $self->{info}{$name}, 3; $self->{info}{$name} = "$key,$type,$synopsis"; } sub get{ my($self,$name) = @_; return split /,/, $self->{info}{$name}, 3; } sub show{ my $self = shift; my $name; print "names: ", $self->{names}, "\n\n"; foreach $name (split /,/, $self->{names}) { my($key,$type,$synopsis) = $self->get($name); print "$name($key) is $type: $synopsis\n"; } } sub tohtml{ my $self = shift; my $data = "
$link$name | \n" . "$synopsis |