Peter Scott wrote:
On Sat, 23 Sep 2006 11:51:54 +0200, Andrej Kastrin wrote:
the script below count word occurences in input file. It uses simple hash structure to store unique words and its frequencies.
[...]
foreach my $w (keys %words) {
    print "$w|$words{$w}\n";
}
[...]
Is that brainy solution in the sense of good programming practice...?

Good start, but you just shot yourself in the foot.  Read 'perldoc -f tie'
and pay especial attention starting at the second paragraph.

Peter, thanks for your response. I already implement 'each' function to iterate over the hash without building the entire list in memory.

Cheers, Andrej

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to