对数组每个元素取值foreach

foreach对数组每个元素取:###########注意到用到了$key
 
my @myNames = ('jacob', 'alexander', 'ethan', 'andrew');
foreach $key (@myNames){ print "$key\n";
结果:
jacob alexander ethan andrew
posted @ 2012-12-13 15:12  蒋蒋  阅读(214)  评论(0编辑  收藏  举报