#! /usr/bin/perl -w $manpage=pop @ARGV; $manpath="/usr/share/man/"; opendir(MANPATH, "$manpath") || die "foo bar: $! "; @files= readdir MANPATH; for $file0(@files){ if ($file0=~m/man(.)/){ opendir (MANX ,"$manpath$file0"); @files1=readdir (MANX); for $nest (@files1){ if ($nest=~m/$manpage(.*)/){ $mandir=$file0; @path=($mandir,$nest); push @path0, [@path]; } $lengh=@path0; } } } for ( $i=0 ;$i < $lengh;$i++ ){ $mand=$path0[$i][0]; $manpage0=$path0[$i][1]; print "$i) $manpage0 in $mand\n"; } print "Access which document?\n"; $docq=; chop $docq; $doc="$manpath$path0[$docq][0]/$path0[$docq][1]"; print "===Accessing $docq) $doc===\n"; print "\n"; system ( "less" ,$doc); EOF: { print"=======THANK YOU FOR YOUR PARTICIPATION=======\n"; print"===========IN TODAYS PENGUIN TUTORIAL =======\n"; print"=========== X to shell out =============\n"; print"=========== M to list docs =============\n"; print"==============================================\n"; $continue=; chop $continue; if ($continue eq "x"){ exec ("/bin/bash"); }elsif($continue eq "m"){ system ("clear"); print "==**THIS FEATURE IS UNDER DEVELOPMENT***===\n"; print "==-- RUN manpl AGAIN--===\n"; goto EOF; }else{ print "\t Ambiguous Selection\n\n"; } }