#!/usr/bin/perl $apipath = "/opt/java/docs/api"; # must have "allclasses-noframe.html" $browser = "/usr/bin/links"; exit unless defined $ARGV[0]; $regexp = $ARGV[0]; $htmlpath = "$apipath/allclasses-noframe.html"; open F, "<$htmlpath"; for $line () { if ($line =~ /(.+)<\/a>/i) { $path = "$apipath/$1"; $class = $2; $class =~ s/<\/?i>//gi; if ($class =~ /^$regexp$/i) { $file{$class} = $path; $count++; $lastfile = $path; } } } close F; exit unless defined %file; exec "$browser $lastfile" if $count == 1; print join ("\n", sort keys %file) . "\n"; exit;