I
ioneabu
#!/usr/bin/perl
#file: pdoc.pl searches perldocs
use warnings;
use strict;
pdoc.pl "perldoc individual words string"
output:
perl5005delta
perl561delta
perl581delta
perlmodlib
perlos2
perlport
Is there anything built in that does this? It runs pretty fast
considering it has to load each perldoc into memory and compare against
each word in search string.
use File::Slurp;
use File::Find;
#file: pdoc.pl: search perldocs
my $string = $ARGV[0];
my @string = split /\s+/, $string;
my $count = scalar @string;
my $path = 'c:\perl\lib\pod';
find(\&wanted, $path);
sub wanted
{
my ($contents, $filename);
$filename = $File::Find::name;
if (/\.pod$/)
{
$contents = read_file($filename) ;
s/\.pod$//;
print $_ , "\n"
if $count == grep {$contents =~ /$_/i} @string;
}
}
#thanks!
#wana
#file: pdoc.pl searches perldocs
use warnings;
use strict;
pdoc.pl "perldoc individual words string"
output:
perl5005delta
perl561delta
perl581delta
perlmodlib
perlos2
perlport
Is there anything built in that does this? It runs pretty fast
considering it has to load each perldoc into memory and compare against
each word in search string.
use File::Slurp;
use File::Find;
#file: pdoc.pl: search perldocs
my $string = $ARGV[0];
my @string = split /\s+/, $string;
my $count = scalar @string;
my $path = 'c:\perl\lib\pod';
find(\&wanted, $path);
sub wanted
{
my ($contents, $filename);
$filename = $File::Find::name;
if (/\.pod$/)
{
$contents = read_file($filename) ;
s/\.pod$//;
print $_ , "\n"
if $count == grep {$contents =~ /$_/i} @string;
}
}
#thanks!
#wana