是什么区别$this,@that和%those在Perl?
我是Perl的新手,在Perl中使用数组有些困难.有人可以向我解释为什么我无法在下面的脚本中打印数组的值.
$sum=();
$min = 999;
$LogEntry = '';
foreach $item (1, 2, 3, 4, 5)
{
$min = $item if $min > $item;
if ($LogEntry eq '') {
push(@sum,"1"); }
print "debugging the IF condition\n";
}
print "Array is: $sum\n";
print "Min = $min\n";
Run Code Online (Sandbox Code Playgroud)
我得到的输出是:
debugging the IF condition
debugging the IF condition
debugging the IF condition
debugging the IF condition
debugging the IF condition
Array is:
Min = 1
Run Code Online (Sandbox Code Playgroud)
我不应该Array is: 1 1 1 1 1(5次).有人可以帮忙吗?谢谢.