#!/usr/bin/perl -T use strict ; use warnings ; use CGI qw/:standard/ ; use CGI::Carp qw/fatalsToBrowser/ ; my $pagesimage = '/images/pages.gif' ; delete $ENV{PATH} ; my $command = param('keyword') ; $command =~ s/[^\w:-].*// ; my %sections = ( 1 => '1: User commands', 2 => '2: System calls', 3 => '3: Library functions', 4 => '4: Devices and network interfaces', 5 => '5: File formats', 6 => '6: Games and demos', 7 => '7: Environments, tables, and troff macros', 8 => '8: Maintenance commands', n => 'n: Tcl/Tk' ) ; my $keywordfield = textfield('keyword','') ; my $sectionmenu = popup_menu( 'section', ['',1,2,3,4,5,6,7,8,'n'], 0, { '','All sections', %sections } ) ; print header(),"
" ;
while () {
$_ = linkline($_) || next ;
#s/$/
/ ;
print ;
}
print " " ;
close WHATIS ;
}
if (open APROPOS, '-|', "/usr/bin/apropos $command") {
print "" ; while (" ; close APROPOS ; } } print <) { $_ = linkline($_) || next ; #s/$/
/ ; print ; } print "