Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Getting unique data from search.

by Three (Pilgrim)
on Nov 14, 2002 at 16:30 UTC ( [id://212897]=note: print w/replies, xml ) Need Help??


in reply to Getting unique data from search.

Simpliy put all titles in a hash as key then print out all keys.
This will elminate all duplicates.
use File::Find; my %titles; sub wanted { if( $_ =~ /\.html?$/) { my $name = $File::Find::name; open ( F, $name ) or die "$!: $name\n"; while($line = <F>) { if($line =~ /<title>(.+)<\/title>/i) { $titles{$1} = " "; } } close F; } foreach my $key (keys %titles) { print "Title = $key\n"; } } find( \&wanted, "/unixpath/webfiles" );

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://212897]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (1)
As of 2024-04-26 02:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found