- 论坛徽章:
- 0
|
机子是惠普unix,64位机
perl版本是5.8.8
120G内存,20、30个CPU
之所以把那么大的文件读进内存,是因为,脚本里面要不断的在那个文件里面搜索数据.
我的代码其中读取文件的部分(我的代码比较烂...):
# 加载account数据
my $hash_account = &get_account_hash();
sub get_account_hash
{
my $file = "$ENV{OUT}/ocs_account.tmp";
open FH,$file or die "open $file error!";
my %hash;
while(<FH>)
{
chomp;
my ($acc_id,$cust_id,@left) = split /\|/;
$hash{$cust_id} = [$acc_id,$cust_id,@left];
}
close FH;
return \%hash;
} |
|
|