分类: PERL
2016-11-03 22:10:11
列表与数组
(1..100,20..1,aa..zz)
@Boys=qw(Greg,Peter,Jim);
@Girls=qw(Kimmy,Lily,Joe);
@Kids=(@Boys,@Girls);
@Family=qw(@Kids,('Father','Mom'));
($a,@fruit,$c)=qw(peaches,apples,bananas,); ##$a=peaches; @fruit=(apples,bananas);
($a,$b,$c)=qw(partridge,robbin,cardinal,qual); ##$a=partridge,$b=robbin,$c=cardinal qual没用
($u,$v,$w,$z)=qw(red,black,white); ##$u=red;$v=black,$w=white,$z=''