&header(); # list java packages with signatures # (c) 1999 Ward Cunningham my $root = "c:/jdk1.3/src"; my $count = 0; my ($search); $search = $1 if $query =~ s/&s=(\w+)//; print "Searching for whole word $search ...

\n" if $search; &scan($query); sub scan { my ($dir) = @_; print "

$dir

\n"; opendir (D, "$root/$dir") or print "$dir: $!
"; my @java = sort grep(/\.java$/, readdir(D)); rewinddir (D); my @dirs = sort grep (-d "$root\\$dir\\$_" && /\w/, readdir(D)); closedir (D); map (&sig("$dir/$_"), @java); map (&scan("$dir/$_"), @dirs); } sub sig { my ($file) = @_; my ($name) = $file =~ /(\w+)\.java/; open (F, "$root/$file") or print "$file: $!"; my (@text) = ; close (F); $_ = join ('', @text); s/[^{;"}]//g; s//$gt;/g; s/&/$and;/g; $count++; print "
$count $name $_\n"; print map ("
  • $_\n", grep(s/\b$search\b/$&<\/b>/, @text)) if $search; }