Solved

Find words in $something.

Posted on 2002-05-13
3
142 Views
Last Modified: 2010-03-05
Hi.
I'm looking for a way to find the number of occurances of a word in a webpage.
I do something like this:

use LWP::Simple;
$doc = get 'http://www.freebsd.org/'

What I'd like to do now is to find out how many "and" there is in this webpage that I currently have in the $doc variable.
Anyone have a clue on how to to this? I'll figure it out eventually by myself but since there are some smart people here I
thought I'd ask.

wbr

.haeger
0
Comment
Question by:haeger
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
bebonham earned 50 total points
ID: 7006950
%count = map { $_ => $count{$_}++ } split(/\s+/,$doc);  
0
 
LVL 8

Expert Comment

by:bebonham
ID: 7007145
why did you give me a b?

you have already noticed that people give you 'A's for your answers, which are not as good, why should you give me a B, without telling me what is wrong with my answer?
0
 
LVL 1

Author Comment

by:haeger
ID: 7007793
Hi.
Nothing is wrong with your answer. I thought you gave me a good answer and since "B" was "Good" I thought that was appropriate.
The answer I got was short, sweet and to the point but there was nothing extra or special. Had there been a more fine-grained scale 1-10 or 1-5 You would have gotten a higher mark(6-7 or 4 respectivly), but in my opinion there is a difference between "Good" and "Excellent".

I'm not impossible however. Do you still feel that the grade is inappropriate and wrong and there is a way to change it I can do that. I really did appriciate your help.

wbr

.haeger
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now