in reply to rtfm
my $lines = 0; my $selection; foreach my $path (split /:/, $ENV{'PATH'}) { opendir(PATH, $path); while (defined($_ = readdir(PATH))) { if (-f "$path/$_") { ++$lines; $selection = $_ if int(rand($lines)) == 0; } } closedir(PATH) } exec(man => $selection);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: rtfm
by dna (Beadle) on Jun 22, 2004 at 18:43 UTC |