4
return bless {names=>'', info=>{}, file=>''};
8
my($self,$name,$key,$type) = @_;
10
$self->{names} .= ",$name";
13
$self->{names} .= "$name";
15
$self->{info}{$name} = "$key,$type,";
18
# The 'file' attribute is used to store the filename of the node in which
19
# the table will be presented; this assumes that each table will be presented
20
# only once, which works for the current use of this object.
23
my($self, $filename) = @_;
24
$self->{file} = "$filename";
33
my($self,$name,$synopsis) = @_;
34
my($key,$type,$unused) = split ',', $self->{info}{$name}, 3;
35
$self->{info}{$name} = "$key,$type,$synopsis";
40
return split /,/, $self->{info}{$name}, 3;
46
print "names: ", $self->{names}, "\n\n";
47
foreach $name (split /,/, $self->{names}) {
48
my($key,$type,$synopsis) = $self->get($name);
49
print "$name($key) is $type: $synopsis\n";
55
my $data = "<table class='synopsistable'>\n";
57
foreach $name (split /,/, $self->{names}) {
58
my($key,$type,$synopsis) = $self->get($name);
59
my $link = "<a href='module-$key.html'>";
61
. "<td><b><tt class='module'>$link$name</a></tt></b></td>\n"
62
. " <td class='synopsis'>$synopsis</td></tr>\n");
64
$data .= "</table>\n";
69
package testSynopsisTable;
72
# this little test is mostly to debug the stuff above, since this is
73
# my first Perl "object".
74
my $st = SynopsisTable->new();
75
$st->declare("sample", "sample", "standard");
76
$st->set_synopsis("sample", "This is a little synopsis....");
77
$st->declare("copy_reg", "copyreg", "standard");
78
$st->set_synopsis("copy_reg", "pickle support stuff");
83
my $st2 = SynopsisTable->new();
84
$st2->declare("st2module", "st2module", "built-in");
85
$st2->set_synopsis("st2module", "silly little synopsis");
89
1; # This must be the last line -- Perl is bogus!