PHILIPS Posted March 21, 2007 Share Posted March 21, 2007 hello everyone,im having troubel making a perl program that will split a list of URLs into .com's and others, and then getting the program to count how many times .com was found, as well as how many times each indevidual address was found. e.g ikea 3 , google 4. The list i am using has each address seperated by line. i can figure out how to seperate the addresses, but i just cant get it to count the results. Can anyone please help :)here is my poor attempt (pulling hair out ://) #!/usr/bin/perl -wsub addressFilter{foreach $line{@SplitAddress =split(/./,$line);$nametofind = @splitAddress[1]if @SplitAddress[2] eq "com" || ".co.uk"{ if (grep {@SplitAddress[2]} @busC) { @array = qw(@busC); %index; @index{@busC} = (0..$#array); $search = @SplitAddress[2]; $index = $index{$search}; $busC[%index] ++;print "<BR>"; } } } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now