Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counting words in an Array

Status
Not open for further replies.

hawaiian1975

Programmer
Nov 7, 2003
26
US
How do I count the number of words in an array?
 
You will need to look at each array entry, count the fields in it, add them to your total and so on and so forth.

$count = 0 ;
foreach my $entry(@array){
# use your word count algorithm here
# add total to $count
}
print "Total words in array is: $count\n" ;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top