On 3/9/06, Practical Perl <[EMAIL PROTECTED]> wrote:
snip
> my $dir="/home/datas/loginIP";    # here stored about 140 files,which are 
> totally 1.7G.
snip
>                 next if /^192\.168\./;
>                 next unless /^(\d+\.\d+\.\d+\.)(\d+)/;
>                 $low{$1}{$2}=1 if $2 < 128;
>
>                 $total{$1}{$2}=1;
snip

Based on the lines I have singled out it looks like your hash will be
very large.  If this is the case then you might consider using a DBM. 
Look at dbmopen, DB::File, NDBM::File, ODBM::File, SDBM::File, and
AnyDBM::File.

You might also consider putting in some debug messages to determine
what section of the code is taking the longest to run.  There is a
profiler for Perl, but I have never used it.

--
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