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 use Symbol qw(gensym);
13 our @ISA=qw(IDZebra::Filter);
18 # Initialization code may come here
24 my $tempfile_in = "/tmp/strucc.in";
25 my $tempfile_out = "/tmp/strucc.out";
26 my $parser = Pod::Text->new (sentence => 0, width => 78);
28 my $r1=$d1->mk_root('pod');
29 my $root=$d1->mk_tag($r1,'pod');
31 # Get the input "file handle"
32 my $inf = $self->get_fh;
34 # Create a funny output "file handle"
36 tie (*$outf,'MemFile');
38 $parser->parse_from_filehandle ($inf, $outf);
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);
65 # ----------------------------------------------------------------------------
66 # Package to collect data as an output file from stupid modules, who can only
68 # ----------------------------------------------------------------------------
89 return (undef) unless ($self->{buff});
90 ($res,$self->{buff}) = split (/\n/,$self->{buff},2);