3 # ----------------------------------------------------------------------------
4 # A dummy example to demonstrate perl filters for zebra. This is going to
5 # extract information from the .pm perl module files.
6 # ----------------------------------------------------------------------------
12 our @ISA=qw(IDZebra::Filter);
17 # Initialization code may come here
23 my $tempfile_in = "/tmp/strucc.in";
24 my $tempfile_out = "/tmp/strucc.out";
25 my $parser = Pod::Text->new (sentence => 0, width => 78);
27 my $r1=$d1->mk_root('pod');
28 my $root=$d1->mk_tag($r1,'pod');
30 # This is dirty... Pod::Parser doesn't seems to support
31 # parsing a string, so we have to write the whole thing out into a
33 open (TMP, ">$tempfile_in");
34 print TMP $self->readall(10240);
37 $parser->parse_from_file ($tempfile_in, $tempfile_out);
41 open (TMP, "$tempfile_out");
44 if (/^([A-Z]+)\s*$/) {
47 my $tag = $d1->mk_tag($root,$section);
48 $d1->mk_text($tag,$data) if ($data);
59 my $tag = $d1->mk_tag($root,$section);
60 $d1->mk_text($tag,$data) if ($data);