in reply to Find most frequently used word in text file.
@values = sort { $a <=> $b } @values;
Tip #1 from the Basic debugging checklist: use strict and warnings. strict generates a compile error, and warnings generates these (and more):
Scalar value @values[-1] better written as $values[-1] Name "main::file" used only once: possible typo
|
|---|