in reply to Limits on a foreach loop
You need to simply break out of the foreach loop you are in
Something like the following would work fine.
Crulx crulx@iaxs.net
Good luck.$i = 0; foreach $key (sort {$freqpage{$b} <=> $freqpage{$a}} keys %freqpage) { print HOTFILES "$freqpage{$key}\n"; print HOTFILES "$key \n"; if($i++ > 20) { last } }
Crulx crulx@iaxs.net
|
---|
In Section
Seekers of Perl Wisdom