![]() |
1
10
我认为你的代码应该是;
换一个试试
|
![]() |
2
11
由于您没有使用“胖逗号”(=>),因此左侧的下划线名称无法获取
auto-quoted
因此,没有信号(
正确的方法是把你的作业改成双箭头
此外,Brad的文章提醒我,即使它们是自动引用的,也不能为文本字符串分配词汇,即使Perl将其解释为自动引用的字符串。 |
![]() |
3
2
哈希只是键、值对的列表。有一个语法结构来帮助区分键和值。它被称为“胖箭”
这就是你想写的:
$s = {'a', 1}; -e syntax OK 这就是你实际写的:
Can't modify constant item in scalar assignment at -e line 1, near "1 }" -e had compilation errors. $s = {'a' = 1}; 这就是为什么我建议您总是在启用警告的情况下启动Perl程序。
Unquoted string "a" may clash with future reserved word at -e line 1. Can't modify constant item in scalar assignment at -e line 1, near "1 }" -e had compilation errors. BEGIN { $^W = 1; } $s = {'a' = 1};
Name "main::s" used only once: possible typo at -e line 1. BEGIN { $^W = 1; } my $s = {'a', 1}; -e syntax OK
最后一个例子说明了为什么您还应该
Global symbol "$s" requires explicit package name at -e line 1. -e had compilation errors. BEGIN { $^W = 1; } use strict 'refs'; ${'s'} = {'a', 1};
我应该声明
BEGIN { $^W = 1; } use strict 'refs'; my $s = {'a', 1}; -e syntax OK 这就是为什么我 总是 从下面开始我的Perl程序:
|
![]() |
aneela · LDAP父项不存在:Openstack OIDC 3 年前 |
|
ScalaMan · 使用pyad创建用户,密码不过期 7 年前 |
![]() |
Karbust · PHP未定义变量ldap 7 年前 |