perl 初始化Hash

Vsftp:/root/perl/6# cat a5.pl
use Data::Dumper;
my @arr=qw/a bc d /;
my %rec=();
for $field (@arr){
$rec{$field} = $field.33;
}
print %rec;
print "\n";
print Dumper(%rec);
print "\n";
Vsftp:/root/perl/6# perl a5.pl
aa33dd33bcbc33
$VAR1 = 'a';
$VAR2 = 'a33';
$VAR3 = 'd';
$VAR4 = 'd33';
$VAR5 = 'bc';
$VAR6 = 'bc33';
上一篇:多目标遗传算法 ------ NSGA-II (部分源码解析)状态报告 打印 report.c


下一篇:pdf2swf 转换时报错。This file is too complex to render- SWF only supports 65536 shapes at once