例:
my $some_variable;
my @some_variable;
my %some_variable;
Run Code Online (Sandbox Code Playgroud)
我知道,@似乎是为了数组,$对于原始,它是完全正确的吗?什么是%?
Perl中嵌套数据结构的简单参考或备忘单是什么?
Perl @variable和$variablePerl 之间有什么区别?
我已经在变量名称之前读取了符号$和符号的代码@.
例如:
$info = "Caine:Michael:Actor:14, Leafy Drive";
@personal = split(/:/, $info);
Run Code Online (Sandbox Code Playgroud)
什么是包含变量之间的区别$,而不是@?
我是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次).有人可以帮忙吗?谢谢.